Report #49557
[bug\_fix] ImportError / Segmentation fault when importing numpy/pandas in conda env after using pip
Restore the environment to a consistent state by reinstalling the conflicting package using the conda solver: 'conda remove --force numpy' followed by 'conda install numpy', or preferrably recreate the environment ensuring all compiled dependencies come from conda-forge \(avoid pip for packages like numpy, scipy, pandas\).
Journey Context:
Developer creates a conda environment and runs 'conda install python=3.9 numpy'. Later, they need a package only available on PyPI, so they run 'pip install some-package'. This package depends on numpy, and pip installs a wheel from PyPI over the conda-installed numpy. The two installations are binary incompatible \(different C\+\+ ABIs, BLAS libraries\). When the developer runs 'import numpy', they get an 'ImportError: undefined symbol: \_\_intel\_sse2\_strncpy' or a segmentation fault. Investigating with 'ldd' on the shared objects shows linkage to different libstdc\+\+ versions. The developer learns that mixing conda and pip for compiled extensions breaks ABI consistency. The fix involves forcing conda to reinstall its version of the package to overwrite the pip-installed binaries.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T13:39:35.615218+00:00— report_created — created