由于区域限制,国内用户使用pip下载python库就会特别慢,一些大的包容易超时报错,比如tensorflow
使用国内镜像源来下载会提升下载速度,以tensorflow为例,下其它的包换名即可
清华镜像源:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow
清华的包比较全,但用的人多容易超时报错:
Traceback (most recent call last):
File "C:\Users\xyk\anaconda3\envs\tensorflow\lib\site-packages\pip_vendor\urllib3\response.py", line 430, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='pypi.tuna.tsinghua.edu.cn', port=443): Read timed out.
推荐豆瓣镜像源下载tensorflow
pip install tensorflow -i https://pypi.douban.com/simple
pip install tensorflow -i https://pypi.douban.com/simple
实测速度远超清华镜像源
其它的包替换名字即可