pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple # pip换源,加快下载速度
pip install tensorflow
由于要用tensorflow模型转换为pytorch模型部署,要用到一个deepdish的库,使用pip install deepdish慢的要死尝试N次仍然下不下来。有时报错如下:
socket.timeout: The read operation timed out
但使用:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple deepdish
瞬间,几秒就解决了!!!!!
永久修改,一劳永逸:
Linux下,修改 ~/.pip/pip.conf (没有就创建一个), 修改 index-url至tuna,内容如下:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
windows下,直接在user目录中创建一个pip目录,如:C:\Users\xx\pip,新建文件pip.ini,内容如下
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple