Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install numba - failing to build wheel for "llvmlite" - please help! #6174

Closed
juliahcodes opened this issue Aug 27, 2020 · 4 comments
Closed
Labels
no action required No action was needed to resolve.

Comments

@juliahcodes
Copy link

juliahcodes commented Aug 27, 2020

Hi,

I'm running Jupyter Notebook with Python 3.7.3 on a Linux Mint Debian Edition 4 machine and would like to speed up some scripts. I've tried using Open MPIP and IPython-Parallel, but the former didn't give much added performance and for the latter I'm somewhat lacking the expertise to rewrite my code for efficient parallelization. Which is why I would now like to try Numba. Unfortunately, when trying to install Numba, I get this error:

juliah@windowsmypc:~$ pip3 install numba
Collecting numba
  Downloading https://files.pythonhosted.org/packages/cb/fd/8f75a154d45aa5ab9f2b55dba1f118f9f6ae14553912de4d4fc606fcb6e2/numba-0.51.0.tar.gz (2.1MB)
    100% |████████████████████████████████| 2.1MB 326kB/s 
Collecting llvmlite<0.35,>=0.34.0.dev0 (from numba)
  Downloading https://files.pythonhosted.org/packages/0b/96/07bfa93a103fb9e3e9ae7f9f7c6687ae714aee66b6f3000da3fad71e0aa2/llvmlite-0.34.0.tar.gz (107kB)
    100% |████████████████████████████████| 112kB 4.0MB/s 
Requirement already satisfied: numpy>=1.15 in /usr/lib/python3/dist-packages (from numba) (1.16.2)
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from numba) (40.8.0)
Building wheels for collected packages: numba, llvmlite
  Running setup.py bdist_wheel for numba ... done
  Stored in directory: /home/juliah/.cache/pip/wheels/b1/09/9e/a433f1d8f4390a1e1202880bcd011bb9023f3bd2400a44be51
  Running setup.py bdist_wheel for llvmlite ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-_r3r2y_m/llvmlite/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-fvhgoipm --python-tag cp37:
  running bdist_wheel
  /usr/bin/python3 /tmp/pip-install-_r3r2y_m/llvmlite/ffi/build.py
  LLVM version... 7.0.1
  
  Traceback (most recent call last):
    File "/tmp/pip-install-_r3r2y_m/llvmlite/ffi/build.py", line 191, in <module>
      main()
    File "/tmp/pip-install-_r3r2y_m/llvmlite/ffi/build.py", line 181, in main
      main_posix('linux', '.so')
    File "/tmp/pip-install-_r3r2y_m/llvmlite/ffi/build.py", line 143, in main_posix
      raise RuntimeError(msg)
  RuntimeError: Building llvmlite requires LLVM 10.0.x or 9.0.x, got '7.0.1'. Be sure to set LLVM_CONFIG to the right executable path.
  Read the documentation at http://llvmlite.pydata.org/ for more information about building llvmlite.
  
  error: command '/usr/bin/python3' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for llvmlite
  Running setup.py clean for llvmlite
Successfully built numba
Failed to build llvmlite
Installing collected packages: llvmlite, numba
  Running setup.py install for llvmlite ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-_r3r2y_m/llvmlite/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-w0zv8fmy/install-record.txt --single-version-externally-managed --compile --user --prefix=:
    running install
    running build
    got version from file /tmp/pip-install-_r3r2y_m/llvmlite/llvmlite/_version.py {'version': '0.34.0', 'full': 'c5889c9e98c6b19d5d85ebdd982d64a03931f8e2'}
    running build_ext
    /usr/bin/python3 /tmp/pip-install-_r3r2y_m/llvmlite/ffi/build.py
    LLVM version... 7.0.1
    
    Traceback (most recent call last):
      File "/tmp/pip-install-_r3r2y_m/llvmlite/ffi/build.py", line 191, in <module>
        main()
      File "/tmp/pip-install-_r3r2y_m/llvmlite/ffi/build.py", line 181, in main
        main_posix('linux', '.so')
      File "/tmp/pip-install-_r3r2y_m/llvmlite/ffi/build.py", line 143, in main_posix
        raise RuntimeError(msg)
    RuntimeError: Building llvmlite requires LLVM 10.0.x or 9.0.x, got '7.0.1'. Be sure to set LLVM_CONFIG to the right executable path.
    Read the documentation at http://llvmlite.pydata.org/ for more information about building llvmlite.
    
    error: command '/usr/bin/python3' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-_r3r2y_m/llvmlite/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-w0zv8fmy/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-install-_r3r2y_m/llvmlite/

I've searched everywhere for a solution and spent a week trying virtually all suggestions, but couldn't fix the issue. Could you please have a look and tell me what's wrong?

This is what I have in my .bashrc:

export PATH=$HOME/.local/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/juliah/.local/lib/python3.7/site-packages/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/python3/dist-packages/
@juliahcodes juliahcodes changed the title Cannot install numba - Cannot install numba - failing building wheel for "llvmlite" Aug 27, 2020
@juliahcodes juliahcodes changed the title Cannot install numba - failing building wheel for "llvmlite" Cannot install numba - failing to build wheel for "llvmlite" - please help! Aug 27, 2020
@esc
Copy link
Member

esc commented Aug 27, 2020

@juliahcodes thanks for submitting this. We have seen this error a lot since the last release, and it is usually because the pip version is too old. What version do you have? You need at least pip version 19.0 to install the binary wheels for llvmlite 0.34.0.

@juliahcodes
Copy link
Author

Oh, no. It seems I have version 18.1. Is there a way I can update it even though it's not provided in the current OS package list?

juliah@windowsmypc:~$ pip3 -V
pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)

@esc esc added the no action required No action was needed to resolve. label Aug 27, 2020
@esc
Copy link
Member

esc commented Aug 27, 2020

@juliahcodes there are many ways that I can think of to install pip beyond the operating systems package manager. Unfortunately, all of them have advantages and disadvantages that would need to be outlined and thought through. Perhaps one of the following two approaches will suite your needs. I list them here to be of my knowledge.

You can use pip to update itself, but you will need root/admin privileges. Also, this may have unforeseen consequences for your operating system package manager. It has worked for me in the past on other linux based distributions but I can not guarantee it will work for you. Anyway, you can try to run sudo pip3 install -U pip to get pip to upgrade itself. However, bear in mind that this does mess with the packages and files installed by the operating system and there is no way to tell in advance what kind of side-effects this may have.

Alternatively, you can download and install the anaconda (or miniconda) individual edition from here:

https://www.anaconda.com/products/individual

This will install an isolated Python environment in your $HOME directory which will not interfere with the files installed by the operating system. One disadvantage here is that you will have multiple python s on your computer and you may get confused about which one you are currently using. However, you should mostly be fine if you follow the online documentation.

After installation and correct configuration you can then proceed to install Numba using conda (which is an alternative to pip): conda install numba

@esc
Copy link
Member

esc commented Aug 27, 2020

I am closing this issue as I believe the root cause was the pip version and this has now been resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no action required No action was needed to resolve.
Projects
None yet
Development

No branches or pull requests

2 participants