python安裝包問題1

1 使用pip安裝包

出現以下問題:

環境: centos 8, python3.8

Could not find a version that satisfies the requirement pytest-runner (from versions: )
No matching distribution found for pytest-runner

需要升級pip

sudo pip3 install  --upgrade pip 

或者

curl https://bootstrap.pypa.io/get-pip.py | python3

上面的下載速度比較慢,可以單獨下載文件https://bootstrap.pypa.io/get-pip.py (迅雷下載很快)。然後安裝

python3 get-pip.py

2 更新pip後重新安裝numpy出現問題

    ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

numpy版本有問題
卸載numpy,重新安裝

pip3 uninstall numpyu
pip3 install numpy

或者升級numpy, 具體請查看參考文章2

3 安裝 pyaudio

環境: centos 7
報錯:

 portaudio.h: No such file or directory

解決方法:

yum install portaudio-devel alsa-lib-devel portaudio
pip3 install pyaudio

參考文章:

文章1:
https://stackoverflow.com/questions/49748063/pip-install-fails-for-every-package-could-not-find-a-version-that-satisfies

文章2: https://blog.csdn.net/weixin_41010198/article/details/86738635

文章3:
https://stackoverflow.com/questions/48690984/portaudio-h-no-such-file-or-directory

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章