例如,要安装tensorflow时,将原本的
sudo pip3 install tensorflow
命令改为
sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow
则会直接通过清华的镜像安装tensorflow,速度会提高很多。
注意:
如果出现
Cannot uninstall 'six'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
这样的错误提示时,则改用如下命令重新安装tensorflow:
sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow --ignore-installed six