python
import_error
ai_generated
partial
ImportError: DLL load failed while importing X
ID: python/importerror-dll-load-failed
80%Fix Rate
85%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 311 | active | — | — | — |
Root Cause
Shared library (.so/.dll) not found. Missing system dependency or wrong architecture.
genericWorkarounds
-
90% success Install the missing system library: apt install libXXX-dev
# Check what's missing: ldd /path/to/module.so | grep 'not found'
-
85% success For conda environments, install with conda which bundles system libs
conda install numpy # includes MKL/OpenBLAS
-
82% success On Windows, install Visual C++ Redistributable
# Download from https://aka.ms/vs/17/release/vc_redist.x64.exe # Or install via winget: winget install Microsoft.VCRedist.2015+.x64
Dead Ends
Common approaches that don't work:
-
Reinstall Python
75% fail
Usually not a Python issue — it's a missing system library
-
Copy DLL from another machine
80% fail
DLLs are architecture-specific and may have dependencies
Error Chain
Frequently confused with: