Python PIP交換用国内インストールソース

1.ピップのいくつかの国内ミラー

外部アドレス:https : //pypi.org/search/

  1. Alibaba Cloud http://mirrors.aliyun.com/pypi/simple/
  2. 中国科学技術大学https://pypi.mirrors.ustc.edu.cn/simple/
  3. Douban(douban)http://pypi.douban.com/simple/
  4. 清華大学https://pypi.tuna.tsinghua.edu.cn/simple/
  5. 中国科学技術大学http://pypi.mirrors.ustc.edu.cn/simple/

2.ソースメソッドを変更する

2.1一時的な使用

pipを使用してpipソースを指定する場合、-iパラメータを後ろに追加できます

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

2.2永続的な変更

Linux:

〜/ .pip / pip.confを変更します(作成しない場合は作成します)。内容は次のとおりです。

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

ウィンドウズ:

など、直接ユーザディレクトリ内のディレクトリピップを作成しますC:\Users\xx\pip

pipディレクトリに新しいファイルを作成します。pip.ini内容は次のとおりです。

[global]
timeout = 6000
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host = pypi.tuna.tsinghua.edu.cn
420件の元の記事を公開しました 143件のいいね 890,000回の閲覧

おすすめ

転載: blog.csdn.net/jeikerxiao/article/details/97245777