pip install 速度很慢 的解决办法-更换安装源

pip命令用于安装和维护python包,不挂VPN的话安装速度一般很慢,

我们可以临时换国内安装源快速提高安装速度:(-i参数,指定pip源 )

eg: pip install tensorflow -i https://pypi.tuna.tsinghua.edu.cn/simple

一些国内安装源的网站:

  1. 阿里云 http://mirrors.aliyun.com/pypi/simple/
  2. 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
  3. 豆瓣(douban) http://pypi.douban.com/simple/
  4. 清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
  5. 中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/

当然还有一劳永逸的永久更换:
PIP 更换国内安装源-SoloLinux

我们也见过下面这样的报错:
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with ‘-m pip’ instead of running pip directly.

此时需要使用 python3 -m pip。这样可以确保您升级并使用 Python pip,而不是系统 pip。

你可能感兴趣的:(人工智能)