【Python】pip换源

最近在玩python,然后经常用pip
但官方的源实在是太慢了,所以我们可以换成国内的:

  1. 新建%APPDATA%\pip\pip.ini
  2. 写入以下内容:
    [global]
    trusted-host = tuna.tsinghua.edu.cn
    index-url = https://pypi.tuna.tsinghua.edu.cn/simple/

参考:https://pip.pypa.io/en/latest/user_guide/#config-file

—————————— UPD 2018.2.2 ——————————
直接走代理,用官方源是最好的
pip3 --proxy 127.0.0.1:6152 install tensorflow

参考:https://www.logcg.com/archives/1914.html

2 thoughts to “【Python】pip换源”

  1. Have you ever considered writing an ebook or guest authoring on other blogs? I have a blog centered on the same subjects you discuss and would really like to have you share some stories/information. I know my viewers would value your work. If you are even remotely interested, feel free to send me an e mail.

  2. Great post. I was checking constantly this blog and I’m impressed! Extremely helpful information specially the last part 🙂 I care for such information a lot. I was seeking this particular information for a long time. Thank you and good luck.

Leave a Reply

Your email address will not be published. Required fields are marked *