Closed Firemanpl closed 4 years ago
See this line:
RuntimeError: llvm-config failed executing, please point LLVM_CONFIG to the path for llvm-config
Ubuntu does not provide a default llvm-config
command. All llvm dev packages provide version suffixed commands like llvm-config-8
or llvm-config-8
. You must tell setup.py which one to use, e.g.:
LLVM_CONFIG=llvm-config-9 python setup.py build
@Firemanpl following up, did the suggestion from @pwuertz help at all? @pwuertz thanks for making that suggestion.
I'm using Numba on the Raspi4 too by the way, works like a charm.
Is LLVM_CONFIG supposed to be an environment variable? Setting it doesn't seem to inform the pip3 process (at whatever step it matters).
@dails08 Yes, it's an ENV variable read by the setup.py build step (see the command line above for a working example). Never used pip for building Numba though. Does pip execute builds in an isolated ENV? If you want pip to manage the module, you could use python setup.py bdist_wheel
to build a .whl
and install that one with pip.
A closer look at my error suggests I have a non-arm version of llvm-config:
OSError: [Errno 8] Exec format error: '/usr/bin/llvm-config'
I'll redo the installation with a closer eye and see where my misstep is. This is a different issue than op, so if I can't figure it out on the retry, I'll open another issue. Thanks!
Oh, looks like this is covered by https://github.com/numba/llvmlite/issues/314
FWIW, on an RPi4 with Raspbian Buster, the following worked for me to install llvmlite:
sudo apt install llvm-9
LLVM_CONFIG=llvm-config-9 pip install llvmlite
@JanLahmann thanks for providing this suggestion. I recently got some more time to look into the build system for llvmlite and get some more experience on how to install on RasPi 4.
While the suggestion to use a distribution based LLVM (installing with apt
) largely works (compiles fine, most of the tests pass etc..), it is important to remember that llvmlite
and numba
require a specialized build of LLVM which carries a number of custom patches. You can read more about building an appropriate LLVM here:
https://llvmlite.readthedocs.io/en/latest/admin-guide/install.html#compiling-llvm
I should also note, that we do provide pre-compiled binaries of the Numba
/llvmlitestack as
conda` packages which should be reasonably painless to install on RasPi 4. More information can be found here:
I will now close this issue, since I believe it has been largely resolved. Should you encounter any similar snags in future, please don't hesitate to open a new issue! Best wishes and thanks for using Numba!
I was trying to install librosa on my RPi 4+ and found the following:
After many paths tried, I finally was able to install on Raspberry Pi 4+. It was necessary, I think, to install LLVM even though llvmlite says not -- to do that required 'sudo apt-get install llvm-9*' since the default is 7.0 and llvmlite requires 9 or 10. Then, to install llvmlite required adding an environment variable as in 'LLVM_CONFIG=llvm-config-9 pip3 install llvmlite' and then 'LLVM_CONFIG=llvm-config-9 pip3 install librosa' .
@joem5636 interesting. I am curious, is it possible to run the librosa test suite to ensure that librosa does indeed function correctly?
I didn't find the test suite. I'm running the examples and for the plot_chroma example I get no output and the (apparently erroneous as I have version 4.4 of colorama) message: /home/pi/.local/lib/python3.7/site-packages/numba/core/errors.py:154: UserWarning: Insufficiently recent colorama version found. Numba requires colorama >= 0.3.9 warnings.warn(msg)
plot_display, same warning; also no output but seems to have run and downloaded two songs.
plot_hprss -- same warning, no output
I looked at generating the tests, but needing MATLAB and a bunch of other things was just too much.
On Fri, Jan 22, 2021 at 4:25 PM esc notifications@github.com wrote:
@joem5636 https://github.com/joem5636 interesting. I am curious, is it possible to run the librosa test suite to ensure that librosa does indeed function correctly?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/numba/llvmlite/issues/604#issuecomment-765692369, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASZUVQUC6DZAVV5ZJFXCVDS3HUNJANCNFSM4OP45XMQ .
-- Best regards,
Joe
@joem5636 OK, thanks for following up. Just to clarify, you do expect output from the code you ran?
I was able to run several examples and wrote my own pitch_switch.py one after the time one. I do get a warning about PyAudio for some reason.
On Tue, Jan 26, 2021, 11:44 AM esc notifications@github.com wrote:
@joem5636 https://github.com/joem5636 OK, thanks for following up. Just to clarify, you do expect output from the code you ran?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/numba/llvmlite/issues/604#issuecomment-767672549, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASZUVTGY4SIVDSB2QXBWQ3S33WNNANCNFSM4OP45XMQ .
FWIW, on an RPi4 with Raspbian Buster, the following worked for me to install llvmlite:
sudo apt install llvm-9
LLVM_CONFIG=llvm-config-9 pip install llvmlite
Dear @JanLahmann
I got the same problem while installing pip qiskit-machine-learning on my Raspberry Pi 4, with ARM64. Any Idea? I follow your suggested step. > sudo apt install llvm-9
LLVM_CONFIG=llvm-config-9 pip install llvmlite
llvm-config
binary. There are a number of reasons this could occur, please see: https://llvmlite.readthedocs.io/en/latest/admin-guide/install.html#using-pip for help.
error: command '/usr/bin/python3' failed with exit status 1llvm-config
binary. There are a number of reasons this could occur, please see: https://llvmlite.readthedocs.io/en/latest/admin-guide/install.html#using-pip for help.
error: command '/usr/bin/python3' failed with exit status 1ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-dj4f9r32/llvmlite_f4a69029b36c4268b746a0194ae57a5a/setup.py'"'"'; file='"'"'/tmp/pip-install-dj4f9r32/llvmlite_f4a69029b36c4268b746a0194ae57a5a/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-vospnj7h/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/pi/.local/include/python3.7m/llvmlite Check the logs for full command output.
Hi @pifparfait , unfortunately I have no experience with the 64bit OS in Raspberry Pi.
Maybe the issue is that it should read pip3
instead of pip
in the following command:
LLVM_CONFIG=llvm-config-9 pip3 install llvmlite
(at the time of posting the above workaround, we were using a virtualenv on RasQberry, for which pip
was correct. But that has changed since then.)
I have already tried with pip3 but without success.
On Mon, 19 Apr 2021 at 22:26, JanLahmann @.***> wrote:
Hi @pifparfait https://github.com/pifparfait , unfortunately I have no experience with the 64bit OS in Raspberry Pi. Maybe the issue is that it should read pip3 instead of pip in the following command: LLVM_CONFIG=llvm-config-9 pip3 install llvmlite (at the time of posting the above workaround, we were using a virtualenv on RasQberry, for which pip was correct. But that has changed since then.)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/numba/llvmlite/issues/604#issuecomment-822762428, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGKQN3ZKCBLN5NHYJ3ZIT23TJSGY3ANCNFSM4OP45XMQ .
-- Parfait Atchadé
Tel Spain: 0034661205543 Tel Deutsch: 00491706659017
For some reason the system is trying to build and install llvmlite.
"Collecting llvmlite<0.37,>=0.36.0rc1 "
This should not happen if it installed successfully before with pip3 install llvmlite
.
Maybe the pip3 install did not install the required version?
In case this does not solve the issue: could you please post the complete install log with commands and output?
Side note: Ubuntu 21.04 for ARM64 / Raspi has llvmlite 0.35
and numba 0.52
now in the apt repository.
Additional side note: using system provided LLVM packages isn't recommended and you can read more about this here: https://llvmlite.readthedocs.io/en/latest/admin-guide/install.html#what-to-be-aware-of-when-using-a-system-provided-llvm-package --
Side note: Ubuntu 21.04 for ARM64 / Raspi has
llvmlite 0.35
andnumba 0.52
now in the apt repository.
@pwuertz what you mean by that? I understood from @esc that pip installation of binary wheels on aarch64 isn't supported yet. Only use conda as a workaround until #665 is completed. But for what I'm doing I guess I can't use it.
For some reason the system is trying to build and install llvmlite. "Collecting llvmlite<0.37,>=0.36.0rc1 " This should not happen if it installed successfully before with
pip3 install llvmlite
. Maybe the pip3 install did not install the required version? In case this does not solve the issue: could you please post the complete install log with commands and output?
@JanLahmann you are right, pip is not installing the package. @esc posted that to me. And suggested to me to use conda, but what I heard, is that for your work Rasqberry, you discouraged using conda. Don't you?. Nevertheless here you have the output message:
pi@raspberrypi:~/rasqberry/libcint/build $ LLVM_CONFIG=llvm-config-9 pip3 install llvmlite Defaulting to user installation because normal site-packages is not writeable Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Requirement already satisfied: llvmlite in /usr/lib/python3/dist-packages (0.27.0)
Hi @pifparfait , I'm not sure why it complains about missing llvmlite, although llvmlite seems to be installed.
Could you provide the complete terminal log when trying to install qiskit and the output of pip3 list
?
I'd recommend to install the qiskit modules one by one, starting with terra, aer, qiskit, and then the additional modules like qiskit-machine-learning.
Hi @JanLahmann,
I provide you with the requested information. Yes, I already managed to install qiskit 0.25. qiskit 0.25.1 qiskit-aer 0.8.1 qiskit-aqua 0.9.1 qiskit-finance 0.1.0 qiskit-ibmq-provider 0.12.2 qiskit-ignis 0.6.0 qiskit-nature 0.1.1 qiskit-optimization 0.1.0 qiskit-terra 0.17.1
What I have not been able to install is qiskit-machine-learning because it gives me the shared error. When it appears, I think it tries to install llvmlite-0.36 and does not succeed, so it breaks the installation.
Package Version
absl-py 0.12.0 amazon-braket-default-simulator 1.1.1.post2 amazon-braket-pennylane-plugin 1.1.0.post1 amazon-braket-schemas 1.1.3 amazon-braket-sdk 1.5.15 appdirs 1.4.4 argon2-cffi 20.1.0 asn1crypto 0.24.0 astroid 2.1.0 asttokens 1.1.13 astunparse 1.6.3 async-generator 1.10 attrs 20.3.0 autograd 1.3 automationhat 0.2.0 backcall 0.2.0 backoff 1.10.0 beautifulsoup4 4.7.1 bleach 3.3.0 blinker 1.4 blinkt 0.1.2 boltons 20.2.1 boto3 1.17.53 botocore 1.20.53 bottle 0.12.19 buttonshim 0.0.2 cachetools 4.2.1 Cap1xxx 0.1.3 certifi 2018.8.24 cffi 1.14.5 chardet 3.0.4 cirq 0.10.0 Click 7.0 colorama 0.3.7 colorzero 1.1 conan 1.35.1 cookies 2.2.1 cryptography 2.6.1 cupshelpers 1.0 cycler 0.10.0 Cython 0.29.21 decorator 4.3.0 defusedxml 0.7.1 deprecation 2.0.7 dill 0.3.3 distro 1.5.0 dlx 1.0.4 docplex 2.20.204 docutils 0.14 drumhat 0.1.0 entrypoints 0.3 envirophat 1.0.0 ExplorerHAT 0.4.2 fastdtw 0.3.4 fasteners 0.16 fastjsonschema 2.15.0 filelock 3.0.12 Flask 1.0.2 fourletterphat 0.1.0 future 0.18.2 gast 0.3.3 gdown 3.12.2 google-api-core 1.26.3 google-auth 1.29.0 google-auth-oauthlib 0.4.4 google-pasta 0.2.0 googleapis-common-protos 1.53.0 gpiozero 1.5.1 grpcio 1.37.0 h5py 2.10.0 html5lib 1.0.1 idna 2.6 importlib-metadata 3.10.1 inflection 0.5.1 ipykernel 5.5.3 ipython 7.22.0 ipython-genutils 0.2.0 ipywidgets 7.6.3 isort 4.3.4 itsdangerous 0.24 jedi 0.18.0 Jinja2 2.10 jmespath 0.10.0 joblib 1.0.1 jsonschema 2.6.0 jupyter 1.0.0 jupyter-client 6.2.0 jupyter-console 6.4.0 jupyter-core 4.7.1 jupyterlab-pygments 0.1.2 jupyterlab-widgets 1.0.0 Keras-Preprocessing 1.1.2 keyring 17.1.1 keyrings.alt 3.1.1 kiwisolver 1.3.1 lazy-object-proxy 1.3.1 llvmlite 0.27.0 logilab-common 1.4.2 lxml 4.6.3 Markdown 3.3.4 MarkupSafe 1.1.0 marshmallow 2.21.0 marshmallow-polyfield 3.2 matplotlib 3.4.1 mccabe 0.6.1 microdotphat 0.2.1 mistune 0.8.4 more-itertools 8.7.0 mote 0.0.4 motephat 0.0.3 mpmath 1.2.1 multitasking 0.0.9 mypy 0.670 mypy-extensions 0.4.1 nbclient 0.5.3 nbconvert 5.4.1 nbformat 5.1.3 nest-asyncio 1.5.1 networkx 2.5.1 node-semver 0.6.1 notebook 6.3.0 ntlm-auth 1.5.0 numpy 1.19.2 oauthlib 2.1.0 olefile 0.46 openfermion 1.0.1 openfermionpsi4 0.5 openfermionpyscf 0.2 opt-einsum 3.3.0 packaging 20.9 pandas 1.2.3 pandocfilters 1.4.3 pantilthat 0.0.7 parso 0.8.2 patch-ng 1.17.4 PennyLane 0.14.1 pexpect 4.6.0 pgzero 1.2 phatbeat 0.1.1 pianohat 0.1.0 pickleshare 0.7.5 piglow 1.2.5 pigpio 1.78 Pillow 8.2.0 pip 21.0.1 plotly 4.14.3 pluginbase 1.0.0 ply 3.11 prometheus-client 0.10.1 prompt-toolkit 3.0.18 protobuf 3.13.0 psutil 5.5.1 ptyprocess 0.7.0 PubChemPy 1.0.4 pyasn1 0.4.8 pyasn1-modules 0.2.8 pybind11 2.6.2 pycairo 1.16.2 pycparser 2.20 pycrypto 2.6.1 pycups 1.9.73 pydantic 1.8.1 pydot 1.4.2 pygame 1.9.4.post1 Pygments 2.8.1 PyGObject 3.30.4 pyinotify 0.9.6 PyJWT 1.7.0 pylatexenc 2.10 pylint 2.2.2 pyOpenSSL 19.0.0 pyparsing 2.4.7 pyrsistent 0.17.3 pyserial 3.4 pysmbc 1.0.15.6 PySocks 1.7.1 python-apt 1.8.4.3 python-constraint 1.4.0 python-dateutil 2.8.1 pytz 2021.1 pyxdg 0.25 PyYAML 5.4.1 pyzmq 22.0.3 qiskit 0.25.1 qiskit-aer 0.8.1 qiskit-aqua 0.9.1 qiskit-finance 0.1.0 qiskit-ibmq-provider 0.12.2 qiskit-ignis 0.6.0 qiskit-nature 0.1.1 qiskit-optimization 0.1.0 qiskit-terra 0.17.1 qtconsole 5.0.3 QtPy 1.9.0 Quandl 3.6.0 rainbowhat 0.1.0 reportlab 3.5.13 requests 2.25.1 requests-ntlm 1.1.0 requests-oauthlib 1.0.0 responses 0.9.0 retrying 1.3.3 retworkx 0.8.0 roman 2.0.0 RPi.GPIO 0.7.0 rsa 4.7.2 RTIMULib 7.2.1 s3transfer 0.3.7 scikit-build 0.11.1 scikit-learn 0.24.1 scipy 1.6.1 scrollphat 0.0.7 scrollphathd 1.2.1 seaborn 0.11.1 SecretStorage 2.3.1 semantic-version 2.6.0 Send2Trash 1.5.0 sense-hat 2.2.0 setuptools 56.0.0 simplejson 3.16.0 six 1.15.0 skywriter 0.0.7 sn3218 1.2.7 sortedcontainers 2.3.0 soupsieve 1.8 spidev 3.4 ssh-import-id 5.7 sympy 1.7.1 tensorboard 2.4.1 tensorboard-plugin-wit 1.8.0 tensorflow 2.3.1 tensorflow-estimator 2.3.0 termcolor 1.1.0 terminado 0.9.4 testpath 0.4.4 thonny 3.3.6 threadpoolctl 2.1.0 toml 0.10.2 tornado 6.1 touchphat 0.0.1 tqdm 4.60.0 traitlets 5.0.5 twython 3.7.0 typed-ast 1.3.1 typing-extensions 3.7.4.3 unicornhathd 0.0.4 urllib3 1.26.4 wcwidth 0.2.5 webencodings 0.5.1 websockets 8.1 Werkzeug 0.14.1 wheel 0.32.3 widgetsnbextension 3.5.1 wrapt 1.12.1 yfinance 0.1.55 zipp 3.4.1
And outdated:
pi@raspberrypi:~/rasqberry/libcint/build $ python3 -m pip list --outdated Package Version Latest Type
asn1crypto 0.24.0 1.4.0 wheel astroid 2.1.0 2.5.3 wheel asttokens 1.1.13 2.0.5 wheel automationhat 0.2.0 0.2.2 wheel beautifulsoup4 4.7.1 4.9.3 wheel boto3 1.17.53 1.17.54 wheel botocore 1.20.53 1.20.54 wheel certifi 2018.8.24 2020.12.5 wheel chardet 3.0.4 4.0.0 wheel Click 7.0 7.1.2 wheel colorama 0.3.7 0.4.4 wheel colorzero 1.1 2.0 wheel conan 1.35.1 1.35.2 wheel cryptography 2.6.1 3.4.7 wheel Cython 0.29.21 0.29.23 wheel decorator 4.3.0 5.0.7 wheel deprecation 2.0.7 2.1.0 wheel docutils 0.14 0.17.1 wheel envirophat 1.0.0 1.0.1 wheel Flask 1.0.2 1.1.2 wheel gast 0.3.3 0.4.0 wheel gpiozero 1.5.1 1.6.2 wheel h5py 2.10.0 3.2.1 sdist html5lib 1.0.1 1.1 wheel idna 2.6 3.1 wheel importlib-metadata 3.10.1 4.0.1 wheel isort 4.3.4 5.8.0 wheel itsdangerous 0.24 1.1.0 wheel Jinja2 2.10 2.11.3 wheel jsonschema 2.6.0 3.2.0 wheel keyring 17.1.1 23.0.1 wheel keyrings.alt 3.1.1 4.0.2 wheel lazy-object-proxy 1.3.1 1.6.0 wheel llvmlite 0.27.0 0.36.0 sdist logilab-common 1.4.2 1.8.1 wheel MarkupSafe 1.1.0 1.1.1 wheel marshmallow 2.21.0 3.11.1 wheel marshmallow-polyfield 3.2 5.10 wheel mypy 0.670 0.812 wheel mypy-extensions 0.4.1 0.4.3 wheel nbconvert 5.4.1 6.0.7 wheel node-semver 0.6.1 0.8.0 wheel numpy 1.19.2 1.20.2 wheel oauthlib 2.1.0 3.1.0 wheel openfermionpyscf 0.2 0.5 wheel pandas 1.2.3 1.2.4 sdist PennyLane 0.14.1 0.15.0 wheel pexpect 4.6.0 4.8.0 wheel pgzero 1.2 1.2.1 wheel protobuf 3.13.0 3.15.8 wheel psutil 5.5.1 5.8.0 sdist pycairo 1.16.2 1.20.0 sdist pycups 1.9.73 2.0.1 sdist pygame 1.9.4.post1 2.0.1 sdist PyGObject 3.30.4 3.40.1 sdist PyJWT 1.7.0 2.0.1 wheel pylint 2.2.2 2.7.4 wheel pyOpenSSL 19.0.0 20.0.1 wheel pyserial 3.4 3.5 wheel pysmbc 1.0.15.6 1.0.23 sdist pyxdg 0.25 0.27 wheel qiskit-ibmq-provider 0.12.2 0.12.3 wheel Quandl 3.6.0 3.6.1 wheel reportlab 3.5.13 3.5.67 sdist requests-oauthlib 1.0.0 1.3.0 wheel responses 0.9.0 0.13.2 wheel roman 2.0.0 3.3 wheel s3transfer 0.3.7 0.4.0 wheel scipy 1.6.1 1.6.2 wheel SecretStorage 2.3.1 3.3.1 wheel semantic-version 2.6.0 2.8.5 wheel simplejson 3.16.0 3.17.2 wheel soupsieve 1.8 2.2.1 wheel spidev 3.4 3.5 sdist ssh-import-id 5.7 5.11 wheel sympy 1.7.1 1.8 wheel tensorboard 2.4.1 2.5.0 wheel tensorflow-estimator 2.3.0 2.4.0 wheel twython 3.7.0 3.8.2 wheel typed-ast 1.3.1 1.4.3 wheel Werkzeug 0.14.1 1.0.1 wheel wheel 0.32.3 0.36.2 wheel yfinance 0.1.55 0.1.59 wheel
Hi @pifparfait , I'm not sure why it complains about missing llvmlite, although llvmlite seems to be installed. Could you provide the complete terminal log when trying to install qiskit and the output of
pip3 list
? I'd recommend to install the qiskit modules one by one, starting with terra, aer, qiskit, and then the additional modules like qiskit-machine-learning.
To solve this issue: I installed LLVM 11 because the llvm was not configured to the right path ("RuntimeError: Building llvmlite requires LLVM 11.x.x, got '9.0.1'. Be sure to set LLVM_CONFIG to the right executable path.") -- This is the Error I got.
Solution: 1: sudo apt install llvm-11 2: LLVM_CONFIG=llvm-config-11 pip3 install llvmlite 3: LLVM_CONFIG=llvm-config-11 pip3 install librosa
Result I got: "Successfully installed librosa-0.9.2 llvmlite-0.39.0 numba-0.56.0 resampy-0.3.1"
Hope this helps
To solve this issue: I installed LLVM 11 because the llvm was not configured to the right path ("RuntimeError: Building llvmlite requires LLVM 11.x.x, got '9.0.1'. Be sure to set LLVM_CONFIG to the right executable path.") -- This is the Error I got.
Solution: 1: sudo apt install llvm-11 2: LLVM_CONFIG=llvm-config-11 pip3 install llvmlite 3: LLVM_CONFIG=llvm-config-11 pip3 install librosa
Result I got: "Successfully installed librosa-0.9.2 llvmlite-0.39.0 numba-0.56.0 resampy-0.3.1"
Hope this helps
Question: llvmlite now has pre-compiled, binary wheels for linux-aarch64, which is Raspberry-PI. What was the reason for not using these and compiling from source?
To solve this issue: I installed LLVM 11 because the llvm was not configured to the right path ("RuntimeError: Building llvmlite requires LLVM 11.x.x, got '9.0.1'. Be sure to set LLVM_CONFIG to the right executable path.") -- This is the Error I got.
Solution: 1: sudo apt install llvm-11 2: LLVM_CONFIG=llvm-config-11 pip3 install llvmlite 3: LLVM_CONFIG=llvm-config-11 pip3 install librosa
Result I got: "Successfully installed librosa-0.9.2 llvmlite-0.39.0 numba-0.56.0 resampy-0.3.1"
Hope this helps
This is the answer i been looking for, Thank you sir or madam!! I'm on RPi 3B+, Buster, Kernel: 5.10.103-v7+, Python -V: 3.7.3
To solve this issue: I installed LLVM 11 because the llvm was not configured to the right path ("RuntimeError: Building llvmlite requires LLVM 11.x.x, got '9.0.1'. Be sure to set LLVM_CONFIG to the right executable path.") -- This is the Error I got. Solution: 1: sudo apt install llvm-11 2: LLVM_CONFIG=llvm-config-11 pip3 install llvmlite 3: LLVM_CONFIG=llvm-config-11 pip3 install librosa Result I got: "Successfully installed librosa-0.9.2 llvmlite-0.39.0 numba-0.56.0 resampy-0.3.1" Hope this helps
This is the answer i been looking for, Thank you sir or madam!! I'm on RPi 3B+, Buster, Kernel: 5.10.103-v7+, Python -V: 3.7.3
May I ask, did you not have any luck withe the binary wheels for llvmlite on PyPi?
To solve this issue: I installed LLVM 11 because the llvm was not configured to the right path ("RuntimeError: Building llvmlite requires LLVM 11.x.x, got '9.0.1'. Be sure to set LLVM_CONFIG to the right executable path.") -- This is the Error I got. Solution: 1: sudo apt install llvm-11 2: LLVM_CONFIG=llvm-config-11 pip3 install llvmlite 3: LLVM_CONFIG=llvm-config-11 pip3 install librosa Result I got: "Successfully installed librosa-0.9.2 llvmlite-0.39.0 numba-0.56.0 resampy-0.3.1" Hope this helps
This is the answer i been looking for, Thank you sir or madam!! I'm on RPi 3B+, Buster, Kernel: 5.10.103-v7+, Python -V: 3.7.3
May I ask, did you not have any luck withe the binary wheels for llvmlite on PyPi?
I downloaded the *.whl and tried to run it without any luck. But i didn't not try to build them from source as explained here. Since the solution from @FardowsaRoble worked for me.
To solve this issue: I installed LLVM 11 because the llvm was not configured to the right path ("RuntimeError: Building llvmlite requires LLVM 11.x.x, got '9.0.1'. Be sure to set LLVM_CONFIG to the right executable path.") -- This is the Error I got. Solution: 1: sudo apt install llvm-11 2: LLVM_CONFIG=llvm-config-11 pip3 install llvmlite 3: LLVM_CONFIG=llvm-config-11 pip3 install librosa Result I got: "Successfully installed librosa-0.9.2 llvmlite-0.39.0 numba-0.56.0 resampy-0.3.1" Hope this helps
This is the answer i been looking for, Thank you sir or madam!! I'm on RPi 3B+, Buster, Kernel: 5.10.103-v7+, Python -V: 3.7.3
May I ask, did you not have any luck withe the binary wheels for llvmlite on PyPi?
I downloaded the *.whl and tried to run it without any luck. But i didn't not try to build them from source as explained here. Since the solution from @FardowsaRoble worked for me.
Oh interesting. Was there no pip
available? Also, do you by any chance recall the error message you received?
Thx @FardowsaRoble, you save my life !
I tried to install conda to install llvmlite but I was missing too many packages.
LLVM_CONFIG=llvm-config-11 pip3 install numba
works very well !
I have the impression that your solution is so simple, that it should necessarily appear in the documentation of Numba.
Anyway thank you very much.
@florianwns @FardowsaRoble thank your for commenting on this. I would like to re-iterate that the llvmlite developers don't advocate for using system provided LLVM packages. Read more about it here:
It would be nice if someone with a RaspberryPi 4 could provide feedback (error logs of installation attempts) as to why the binary wheels for this platform that we do provide on PyPi don't work. They really should and no-one should encounter issues when installing llvmlite. If any of you have a spare minute that feedback would be most appreciated so that we can solve this issue properly and no longer need to rely on "hacks".
My guess about the issues that people using pip3
-- the pip3
may be too old? I just double checked on PyPi:
https://pypi.org/project/llvmlite/0.39.1/#files
And the wheels for the RPi4 (which are aarch64
wheels) are indeed uploaded and present and I don't understand why pip3
isn't picking them up. Could someone who tried the pip3
route perhaps post the pip3
version they are using? Thank you! I really would like to get this solved, such that folks no longer need to use system packages and compile llvmlite from source. 🙏
@esc Hi, I would like to report my case with two RPis.
(1) Raspberry Pi 4 Model B:
python3 -V
: Python 3.9.2pip3 -V
: pip 20.3.4numba
0.56.4 along with llvmlite
0.39.1 using sudo pip3 install numba
(2) Raspberry Pi Zero:
python3 -V
: Python 3.9.2pip3 -V
: pip 20.3.4llvmlite
0.39.1 using sudo pip3 install llvmlite
pip
20.3.4 is the latest version that is installed using sudo apt install python3-pip
.
It was impossible to install llvmlite
0.39.1 even after updating pip
to 23.1 by using sudo pip3 install --upgrade pip
,
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting llvmlite
Using cached llvmlite-0.39.1.tar.gz (132 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: llvmlite
Building wheel for llvmlite (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [11 lines of output]
running bdist_wheel
/usr/bin/python3 /tmp/pip-install-9k9aa8iq/llvmlite_0bf87cded5b543f58cbd2e37cf132a3c/ffi/build.py
LLVM version... Traceback (most recent call last):
File "/tmp/pip-install-9k9aa8iq/llvmlite_0bf87cded5b543f58cbd2e37cf132a3c/ffi/build.py", line 226, in <module>
main()
File "/tmp/pip-install-9k9aa8iq/llvmlite_0bf87cded5b543f58cbd2e37cf132a3c/ffi/build.py", line 216, in main
main_posix('linux', '.so')
File "/tmp/pip-install-9k9aa8iq/llvmlite_0bf87cded5b543f58cbd2e37cf132a3c/ffi/build.py", line 135, in main_posix
raise RuntimeError(msg) from None
RuntimeError: Could not find a `llvm-config` binary. There are a number of reasons this could occur, please see: https://llvmlite.readthedocs.io/en/latest/admin-guide/install.html#using-pip for help.
error: command '/usr/bin/python3' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for llvmlite
Running setup.py clean for llvmlite
Failed to build llvmlite
ERROR: Could not build wheels for llvmlite, which is required to install pyproject.toml-based projects
@snio89 thank you for your response, it was very helpful.
(1) Raspberry Pi 4 Model B:
- Succeeded to install
numba
0.56.4 along withllvmlite
0.39.1 usingsudo pip3 install numba
Thank you for confirming the above, this means 64 bit linux wheels can indeed be installed on a RPi! 🎉
(2) Raspberry Pi Zero:
- Failed to install
llvmlite
0.39.1 usingsudo pip3 install llvmlite
This points at the issue being related to 32-bit linux wheels.
From what I can tell the description at https://realpython.com/python-wheels/ suggests i686
wheels should be linux 32-bit and https://pypi.org/project/llvmlite/0.39.1/#files does indeed have i686
wheels -- so the question is, why can pip
not find them?? One guess I have is that pip
is defaulting to the cache, which has the source package. You could try using the latest pip
(23.1) with the --no-cach-dir
option https://stackoverflow.com/questions/45594707/what-is-pips-no-cache-dir-good-for -- perhaps that will fix things up?
From what I can tell the description at https://realpython.com/python-wheels/ suggests
i686
wheels should be linux 32-bit and https://pypi.org/project/llvmlite/0.39.1/#files does indeed havei686
wheels -- so the question is, why canpip
not find them?? One guess I have is thatpip
is defaulting to the cache, which has the source package. You could try using the latestpip
(23.1) with the--no-cach-dir
option https://stackoverflow.com/questions/45594707/what-is-pips-no-cache-dir-good-for -- perhaps that will fix things up?
So, researching some more here, the i686
is 32-bit x86 instruction set? But the RPi you are running has a 32-bit ARM instruction set? This would mean, there is no wheel available for this architecture. Also, looking at: https://github.com/pypa/manylinux -- I am not even sure that the wheel format supports this architecture.
This points at the issue being related to 32-bit linux wheels.
From what I can tell the description at https://realpython.com/python-wheels/ suggests
i686
wheels should be linux 32-bit and https://pypi.org/project/llvmlite/0.39.1/#files does indeed havei686
wheels -- so the question is, why canpip
not find them?? One guess I have is thatpip
is defaulting to the cache, which has the source package. You could try using the latestpip
(23.1) with the--no-cach-dir
option https://stackoverflow.com/questions/45594707/what-is-pips-no-cache-dir-good-for -- perhaps that will fix things up?
The Raspberry Pi Zero is 32-bit ARM, not 32-bit x86 - did we do wheels for 32-bit ARM?
edit: Never mind, you beat me to it @esc :-)
@gmarkall ok, yes, that would make sense then. No 32-bit ARM support. Thank you for confirming!
@snio89 perhaps it is possible to install a 64 bit OS on the Raspberry Pi Zero? Looking at:
https://en.wikipedia.org/wiki/Raspberry_Pi
The following suggests you need a Raspberry Pi Zero 2 W
since that is the first RPi Zero to support 64-bit.
@esc I am sorry but I don't have RPi Zero 2 now. If llvmlite
does not have a wheel for 32-bit ARM, it would be better for me to give up using RPi Zero and/or 32-bit OS.
I can test the following things tomorrow, though I am not sure these tests will be helpful.
sudo pip3 install llvmlite
for pip
20.3.4 and 23.1, RPi 4 with 32-bit OSsudo pip3 install llvmlite --no-cache-dir
for pip
20.3.4 and 23.1, RPi 4 with 32-bit OSsudo pip3 install llvmlite --no-cache-dir
for pip
20.3.4 and 23.1, RPi Zero with 32-bit OS@snio89 I think the lack of 32-bit ARM manylinux wheels is indeed the case of your issue. I am not sure what to recommend now. All other options have their own risks or are tricky.
a) Compile LLVM from source -- this is quite tricky to get right, since Numba/llvmlite requires a patched LLVM
b) Install LLVM via apt
-- this then comes with the risk of using an unpatched LLVM, so some of Numba/llvmlite's behaviour may be unpredictable.
Some folks above have recommended and posted instructions for b) using the LLVM_CONFIG
environment variable above. It seems to work for them. However, if you try this and run into issues you may end up on your own as this isn't an officially supported use-case. But, as @FardowsaRoble points out, the following may succeed:
sudo apt install llvm-11
LLVM_CONFIG=llvm-config-11 pip3 install llvmlite
@snio89 you could also see if llvmlite
is available in your OS by doing sudo apt search llvmlite
@esc Thanks for the help. I had checked the solution of @FardowsaRoble and it seemed possible to install llvmlite
using apt
. The lack of patch for llvmlite
was the reason I hesistated to apply this solution but it seems like there is no other choice for me. Thank you again for your help and support for the community.
This is just a suggestion: how about mentioning the current situation with the 32bit ARM and pip
on the numba
installation document?
https://numba.readthedocs.io/en/stable/user/installing.html
I also faced a similar problem for the numpy
installation (upgrade) using pip
. And I found that numpy
provides an introduction for this problem.
https://numpy.org/doc/stable/user/troubleshooting-importerror.html
It would be very helpful for Raspberry Pi users if the numba
documentation provides an information for this situation.
This is just a suggestion: how about mentioning the current situation with the 32bit ARM and
pip
on thenumba
installation document? https://numba.readthedocs.io/en/stable/user/installing.html
Probably not a bad idea. I had previously assumed this was a niche use-case, however it seems like there is quite some demand, judging from the opened issues on the llvmlite issue-tracker.
If anyone is interested: I managed to install numba 0.56.4 on a raspberry pi zero 2 w. However, I had to use some workarounds, here is how i did it:
sudo apt install -y llvm-dev libffi-dev
sudo apt-get install -y libatlas-base-dev libopenjp2-7
pip install llvmlite==0.39.1
into a virtual environmentAt this point I faced the issue, that the installer froze builing a wheel for llvmlite. ChatGPT helped by recommending to increase the SWAP size in /etc/dphys-swapfile
to 1024 (Default was 100). The parameter is called CONF_SWAPSIZE
pip install numba==0.56.4
I really hope it helps someone. I took me quite some time to figure this out...
If anyone is interested: I managed to install numba 0.56.4 on a raspberry pi zero 2 w. However, I had to use some workarounds, here is how i did it:
Thank you for adding this! It's always good to hear about someones experience. I will ask for some clarification in-line.
- OS: Raspberry Pi OS Lite (32bit)
- For llvmlite to be installed successfully, I installed
sudo apt install -y llvm-dev libffi-dev
Which version of llvm-dev
is this?
- For numpy to run successfully, I installed
sudo apt-get install -y libatlas l#ibopenjp2-7
Did you mean libopenjp2-7
and not l#ibopenjp2-7
?
- After that i used
pip install llvmlite==0.39.1
into a virtual environment
Why not use the latest release? 0.40.1
?
At this point I faced the issue, that the installer froze builing a wheel for llvmlite. ChatGPT helped by recommending to increase the SWAP size in
/etc/dphys-swapfile
to 1024 (Default was 100). The parameter is calledCONF_SWAPSIZE
- After that i was able to install numpy into my virtual environment using
pip install numpy==0.56.4
The numpy
package isn't available in a version 0.56.4
but Numba is. Did you perhaps mean pip install numpy==0.56.4
?
I really hope it helps someone. I took me quite some time to figure this out...
Yeah, installation on 32 bit RPis is currently a daunting task that requires a lot of manual cranking.
Hi! Thank you for your feedback. I fixed the typos in my above comment. Today, I tried to install version 0.57.1 of numba. I followed my instructions above.
pip install llvmlite==0.40.1
. It took quite some time to install and it seemed that the installer froze while building the wheel. Ultimately, it succeeded.pip install numba==0.57.1
succeeded.ImportError: Numba requires at least version 14.0.0 of LLVM. Installed llvmlite is built against version 11.0.1.
llvm-config --version
I could confirm version 11.0.1.I then tried to figure out how to update llvm. However, since I am quite new to programming and linux, i decided to give up...
Update: I successfully installed numba 0.58.1 on my Raspberry Pi Zero 2 W (hooray). Here is what I did:
sudo apt install -y llvm-dev libffi-dev
sudo apt-get install -y python3-pip
sudo apt install -y python3-venv
python -m venv venv
and activated it: source venv/bin/activate
pip install numba==0.58.1
, i succeeded in installing numba and with it llvmlite. Note: It took roughly 30 minutes and the installation process seemed frozen during installation at least three times.