1. 程式人生 > >python庫快速安裝的方法(映象網站)

python庫快速安裝的方法(映象網站)

1.可以使用的庫

阿里雲:http://mirrors.aliyun.com/pypi/simple/
清華:https://pypi.tuna.tsinghua.edu.cn/simple/
中國科技大學 https://pypi.mirrors.ustc.edu.cn/simple/
華中理工大學:http://pypi.hustunique.com/
山東理工大學:http://pypi.sdutlinux.org/ 
豆瓣:http://pypi.douban.com/simple/

使用方法: pip3 install python庫名稱 -i 映象網站網址。 以在豆瓣映象下載tensorflow為例,pip3 install tensorflow -i

http://pypi.douban.com/simple(提示:pip指令視自身python版本而定)

2.安裝過程遇到的問題:
a.網站的不信任問題:The repository located at pypi.doubanio.com is not a trusted or secure host and is being ignored.
解決方法:
①將上述指令http改成https,如pip3 install tensorflow -i https://pypi.douban.com/simple
②將上述指令改成pip3 install tensorflow -i http://pypi.douban.com/simple

--trusted-host pypi.douban.com
b.安裝scrapy遇到的wristed問題:error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools"
解決方法:首先開啟(https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted),找到對應版本的Twisted並下載到你的資料夾。(注意twisted版本要對應python版本)
然後利用 pip3 install D:\Twisted-18.9.0-cp36-cp36m-win_amd64.whl 命令安裝指定儲存路徑下的whl檔案。安裝成功後,執行指令pip3 install Scrapy即可。