Report #60620
[bug\_fix] ImportError: DLL load failed: The specified module could not be found \(Windows\) or 'undefined symbol' \(Linux\) when importing a package installed via pip into a conda environment
Conda manages its own C/C\+\+ runtime libraries \(MSVC runtime on Windows, libstdc\+\+ on Linux\) and binary ABI compatibility. Installing pip packages that compile against system libraries \(or different versions\) into a conda environment causes ABI conflicts, especially for scientific packages \(numpy, scipy, pandas\) with C extensions. Fix: Prefer conda-forge channels for all compiled dependencies: 'conda install -c conda-forge numpy pandas' instead of 'pip install numpy'. If pip must be used, ensure 'conda install pip' is run first \(to use conda-managed pip\) and avoid mixing compiled extensions. If already broken, create a fresh environment using only conda packages.
Journey Context:
Developer creates a conda environment \('conda create -n myenv python=3.10'\) and activates it. They then use 'pip install numpy' \(or another compiled package\) instead of 'conda install numpy'. Later, when importing numpy, they get 'ImportError: DLL load failed' on Windows or 'undefined symbol: \_\_something' on Linux. They might try reinstalling or checking LD\_LIBRARY\_PATH. The root cause is that conda's Python and its C extensions are compiled against specific versions of system libraries \(like libgcc, MSVC runtime\) that conda manages in the environment's 'lib/' directory. When pip installs a wheel, it often brings in binaries linked against the host system's libraries \(e.g., /usr/lib/libgcc\), which are incompatible with conda's versions. This causes symbol conflicts or missing DLLs at runtime. The fix works by ensuring all binary components come from the conda ecosystem, which maintains internal ABI consistency, or by using conda's pip which is aware of the environment's library paths.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T08:14:25.820132+00:00— report_created — created