pip:Could not find a version that satisfies the requirement Twisted==15.5.0 (from versions: none)

pip安裝某些包失敗
因爲網絡原因,這種情況指定安裝源就好:

pip install SomeProject -i http://my.package.repo/simple/ 

常用源:
阿里雲 http://mirrors.aliyun.com/pypi/simple/
中國科技大學 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清華大學 https://pypi.tuna.tsinghua.edu.cn/simple/
中國科學技術大學 http://pypi.mirrors.ustc.edu.cn/simple/
官方源:https://pypi.org/simple/

但今日遇到的不是這個原因,而是因爲Twisted這個包是bz2的包:
https://pypi.org/simple/twisted/
https://pypi.org/simple/twisted/
因爲沒有安裝bzip2-devel的系統包導致pip不支持bz2後綴的包。
解決辦法:

yum install bzip2-devel

重新編譯python3即可。

不想重新編譯python3的話,也可以直接下載要安裝的包,解壓再安裝:

wget https://files.pythonhosted.org/packages/de/75/7495f210c6bb6af33a09f81f5f351a47f12b9989ee8e3c4623e95ece3c97/Twisted-15.5.0.tar.bz2#sha256=a8046804a0dfae090234bbb90fc560a6cc11a208b3d048b55244c79c1945c17f
bzip2 -d Twisted-15.5.0.tar.bz2
python3 install ./Twisted-15.5.0.tar

安裝成功。

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