ImportError: DLL load failed while importing lib
Third-person routing text. Fixes pyarrow failing on Windows with DLL load failed while importing lib: mismatched or missing Visual C++ runtime or a corrupt wheel. Reinstall pyarrow from a fresh wheel and ensure the VC++ redistributable is present. Use when an agent hits this importing pyarrow on Windows. Not for other pyarrow errors.
TL;DR: pyarrow's bundled native library will not load on your Windows box. Reinstall pyarrow from a fresh wheel and make sure the Visual C++ redistributable is installed.
The error
ImportError: DLL load failed while importing libFix it
- Reinstall pyarrow cleanly:
pip install --force-reinstall pyarrowExpected: downloads and installs a fresh wheel.
- Make sure the Visual C++ redistributable (2015 or later) is installed on the machine; pyarrow's DLLs need it. Expected: installer completes.
- Verify:
python -c "import pyarrow; print(pyarrow.__version__)"Expected: prints the version, no DLL error.
When this applies
Use this when import pyarrow on Windows raises the DLL load failed message.
When it does not apply
On Linux or macOS this specific message does not occur; look for the platform's own shared-library error. If a different DLL name is missing, install that component instead.
Compatibility
Windows, pyarrow wheels with bundled native libs.
Root cause
pyarrow ships compiled C++ libraries inside the wheel. If the wheel download was corrupt, partially overwritten, or the system C++ runtime is missing, Windows cannot load the bundled lib and Python surfaces this terse error.
Edge cases
Antivirus quarantining the DLL mid-install causes repeat failures; reinstall with it paused if needed. Mixing pip and conda pyarrow in one env is a classic way to get mismatched native libs; pick one installer.
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.