numba: Segfault when importing numba in conda environment

While trying to figure out what is causing https://github.com/lmcinnes/pynndescent/issues/70, I’ve realized something very strange.

Importing numba causes a segfault:

> python -c 'import numba' 
zsh: segmentation fault (core dumped)  python -c 'import numba'

However, this only happens in a conda environment. I can get this segfault consistently by setting up the environment like this:

conda create --name tmp python=3.7.4
conda activate tmp
pip install numba
python -c 'import numba'  # segfault

However, if I set up the environment using virtualenv, everything is fine:

virtualenv venv
source venv/bin/activate
pip install numba
python -c 'import numba'  # NO segfault

In both cases, the exact same packages are installed

> pip freeze
llvmlite==0.29.0
numba==0.45.1
numpy==1.17.1

Additionally, llvmlite doesn’t seem to be the problem, since I can run python -c 'import llvmlite' without segfaulting.

At first, I suspected this had something to do with the new numpy version since it started failing at about the same time as the 1.17 release, but I can reproduce the segfault by downgrading numpy both to 1.16.4 and 1.15.4, so the issue must lie in numba somewhere.

I’m running Arch Linux x86_64 using Kernel: 5.2.11-arch1-1-ARCH.

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 4
  • Comments: 29 (12 by maintainers)

Most upvoted comments

I had the same issue with an install of numba from pypi into a conda environment (as a dependency of another package only on pypi). Installing llvmlite from conda, fixed the problem. I’m running fedora 29 and have python 3.7.3 in the conda environment. For ldd I see:

$ ldd --version
ldd (GNU libc) 2.28

I just noticed the following: for whatever its worth, when I import scipy.optimize before numba, it does not segfault. Version info

python: 3.7.4 
numba: 0.48.0

I had the same issue with an install of numba from pypi into a conda environment (as a dependency of another package only on pypi). Installing llvmlite from conda, fixed the problem. I’m running fedora 29 and have python 3.7.3 in the conda environment. For ldd I see:

$ ldd --version
ldd (GNU libc) 2.28

This worked for me too. Just go conda install numba==0.46. Done. Using python 3.7.5 and Ubuntu 19.10