美文网首页
pip/pip3 更换源

pip/pip3 更换源

作者: 乌合中壹 | 来源:发表于2018-07-19 11:31 被阅读50次

以 tsinghua 为例:

临时使用

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
注意,simple 不能少, 是 https 而不是 http

设为默认

  • Linux

    修改 ~/.config/pip/pip.conf

  • Windows

    修改 %APPDATA%\pip\pip.ini

  • MacOS

    修改 $HOME/Library/Application Support/pip/pip.conf

配置文件内容如下:

   [global]
   index-url = https://pypi.tuna.tsinghua.edu.cn/simple

另外,pip 和 pip3 并存时,只需修改 ~/.pip/pip.conf

相关文章

网友评论

      本文标题:pip/pip3 更换源

      本文链接:https://www.haomeiwen.com/subject/aiazpftx.html