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即可。

猜你喜欢

转载自blog.csdn.net/weixin_42069167/article/details/83650419