BUG: Cannot install SciPy using pip on Raspberry Pi
See original GitHub issueDescribe your issue.
Tried to install scipy through pip3 install -3 requirements.txt with the following:
librosa==0.6.3 numpy pandas soundfile==0.9.0 wave scikit-learn==0.24.2 tqdm==4.28.1 matplotlib==2.2.3 pyaudio==0.2.11
but it gave an error. Already tried using sudo apt-get install python3-scipy, but still the same issue happens.
Reproducing Code Example
N/A - all I did is run sudo LLVM_CONFIG=`which llvm-config-11` pip3 install -r requirements.txt
Error message
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [55 lines of output]
The Meson build system
Version: 0.62.2
Source dir: /tmp/pip-install-93y57wnw/scipy_34185744f91f4e619985e97d31e27821
Build dir: /tmp/pip-install-93y57wnw/scipy_34185744f91f4e619985e97d31e27821/.mesonpy-b9th5ncm/build
Build type: native build
Project name: SciPy
Project version: 1.9.0
C compiler for the host machine: cc (gcc 8.3.0 "cc (Raspbian 8.3.0-6+rpi1) 8.3.0")
C linker for the host machine: cc ld.bfd 2.31.1
C++ compiler for the host machine: c++ (gcc 8.3.0 "c++ (Raspbian 8.3.0-6+rpi1) 8.3.0")
C++ linker for the host machine: c++ ld.bfd 2.31.1
Host machine cpu family: arm
Host machine cpu: armv7l
Compiler for C supports arguments -Wno-unused-but-set-variable: YES
Library m found: YES
Fortran compiler for the host machine: gfortran (gcc 8.3.0 "GNU Fortran (Raspbian 8.3.0-6+rpi1) 8.3.0")
Fortran linker for the host machine: gfortran ld.bfd 2.31.1
Program cython found: YES (/tmp/pip-build-env-wco6m20p/overlay/bin/cython)
Program pythran found: YES (/tmp/pip-build-env-wco6m20p/overlay/bin/pythran)
Program cp found: YES (/usr/bin/cp)
Program python3 found: YES (/usr/local/bin/python3.9)
Found pkg-config: /usr/bin/pkg-config (0.29)
../../scipy/meson.build:40:0: ERROR: Command "/usr/local/bin/python3.9 -c import os; os.chdir(".."); import numpy; print(numpy.get_include())" failed with status 1.
A full log can be found at /tmp/pip-install-93y57wnw/scipy_34185744f91f4e619985e97d31e27821/.mesonpy-b9th5ncm/build/meson-logs/meson-log.txt
+ meson setup --native-file=/tmp/pip-install-93y57wnw/scipy_34185744f91f4e619985e97d31e27821/.mesonpy-native-file.ini -Ddebug=false -Doptimization=2 --prefix=/usr/local /tmp/pip-install-93y57wnw/scipy_34185744f91f4e619985e97d31e27821 /tmp/pip-install-93y57wnw/scipy_34185744f91f4e619985e97d31e27821/.mesonpy-b9th5ncm/build
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
main()
File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-wco6m20p/overlay/lib/python3.9/site-packages/mesonpy/__init__.py", line 909, in get_requires_for_build_wheel
with _project(config_settings) as project:
File "/usr/local/lib/python3.9/contextlib.py", line 119, in __enter__
return next(self.gen)
File "/tmp/pip-build-env-wco6m20p/overlay/lib/python3.9/site-packages/mesonpy/__init__.py", line 888, in _project
with Project.with_temp_working_dir(
File "/usr/local/lib/python3.9/contextlib.py", line 119, in __enter__
return next(self.gen)
File "/tmp/pip-build-env-wco6m20p/overlay/lib/python3.9/site-packages/mesonpy/__init__.py", line 547, in with_temp_working_dir
yield cls(source_dir, tmpdir, build_dir)
File "/tmp/pip-build-env-wco6m20p/overlay/lib/python3.9/site-packages/mesonpy/__init__.py", line 463, in __init__
self._configure(reconfigure=bool(build_dir) and not native_file_mismatch)
File "/tmp/pip-build-env-wco6m20p/overlay/lib/python3.9/site-packages/mesonpy/__init__.py", line 494, in _configure
self._meson(
File "/tmp/pip-build-env-wco6m20p/overlay/lib/python3.9/site-packages/mesonpy/__init__.py", line 477, in _meson
return self._proc('meson', *args)
File "/tmp/pip-build-env-wco6m20p/overlay/lib/python3.9/site-packages/mesonpy/__init__.py", line 472, in _proc
subprocess.check_call(list(args))
File "/usr/local/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['meson', 'setup', '--native-file=/tmp/pip-install-93y57wnw/scipy_34185744f91f4e619985e97d31e27821/.mesonpy-native-file.ini', '-Ddebug=false', '-Doptimization=2', '--prefix=/usr/local', '/tmp/pip-install-93y57wnw/scipy_34185744f91f4e619985e97d31e27821', '/tmp/pip-install-93y57wnw/scipy_34185744f91f4e619985e97d31e27821/.mesonpy-b9th5ncm/build']' returned non-zero exit status 1.
[end of output]
SciPy/NumPy/Python version information
Python 3.9 - NumPy 1.22.4
Issue Analytics
- State:
- Created a year ago
- Comments:14 (8 by maintainers)
Top Results From Across the Web
Can't install scipy to Raspberry pi 4 (raspbian) - Stack Overflow
I am trying to install the scipy library with python3 -m pip install --user --no-use-pep517 scipy but I am receiving the following error:...
Read more >How to install latest Scipy version on Raspberry Pi
The main reason is that scipy relies on compiled C and fortran libraries, that need to be compiled on the same architecture. Usually...
Read more >Installing Scipy - Raspberry Pi Forums
I am new to raspberry and python and I have a few questions that need. ... to install using the command $ sudo...
Read more >Installing scipy on raspberry pi 4 error · Issue #77 - GitHub
Running from scipy source directory. /tmp/pip-build-env-hwix6duo/lib/python3. 7/site-packages/numpy/distutils/system_info. py:624: UserWarning:
Read more >Installing scikit-learn
There are different ways to install scikit-learn: Install the latest official release. This is the best approach for most users. It will provide...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yep – it’s a raspberry pi 3b+ with Buster in it – and it fixed itself when I downgraded the Python from 3.9 to 3.7 due to some “glibc” errors.
Thanks @rgommers, and sorry for replying late. The Meson log revealed the actual issue:
libcblas.so.3
was missing.I have uploaded the complete log without truncation here for reference.
After running
apt install libatlas-base-dev
(as described in this StackOverflow answer),scipy==1.9.3
was installed successfully.Therefore the complete installation process for RPi4 would be: