Linux or Raspberry Pi 4B use apt or pip to install scipy

The following installation process is successfully installed on the Raspberry Pi 4B, record it for reference only.

Python 3.7 is installed using apt (note: it seems that the python version can only be below 3.8, other versions can also be tried)

sudo apt-get install libblas-dev liblapack-dev libatlas-base-dev gfortran --fix-missing -y
sudo apt-get install python3-scipy -y
# 安装过程种出现无法定位包 之类的 可以执行下面的命令,然后再重新装
sudo apt-get update

python 3.9 install using pip

sudo pip3 install scipy
# 为了不出现后面图中的错误 下面两条命令也执行吧
sudo apt-get install libatlas-base-dev -y
sudo pip3 install numpy --upgrade

Downloading this package is very slow, you can also download it from the link below on the hanging ladder, and copy it into the Raspberry Pi

https://www.piwheels.org/simple/scipy/SciPy-1.8.1-cp39-cp39-linux_armv7l.whl

Then use the following command to install

sudo pip3 install SciPy-1.8.1-cp39-cp39-linux_armv7l.whl

If you encounter the errors in the following two pictures while using this package

Use the following command to solve

sudo apt-get install libatlas-base-dev -y

And (the following situation seems to be that the numpy version is low, my numpy version was 1.19.5)

Upgrade numpy using the following command

sudo pip3 install numpy --upgrade

Guess you like

Origin blog.csdn.net/qq_45064423/article/details/126268112