Pip taught you to change the source, let your Python Library Download whizzing (Series II)

/1 Introduction/

    Today, we say it's pip python source change it, change the source, relatively speaking, it is quite important to make themselves less raw gas several times, ha ha ha! Monday, when small series issued taught you to pip change source Python library allows you to download whizzing (series a), no time on the train junior partner, you can go in and see stamp.

    In the message at the last article, I saw a man named hxw heroes of generous comments, details as shown below.

640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1

    With the heart of learning, Xiao Bian personally to try and find a method that provides effective, now sorted out for everyone to share . hxw If you see this article, you can get the background micro-channel small series, small series will be given a small token of my gratitude red envelope.


/ 2 why changed the source /

  I believe that small partners must have encountered such a problem with me, as shown below.

640?wx_fmt=jpeg&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1

    Yes, it is something we pip installation time , sometimes easy floating yellow rosy , but most of the time slower. This is because we went to get the package , from abroad to take direct.

    Although there are walls , but for our study , it is still set aside some of the eight children of the site , but it is still slow , after all, too far , we supposed to do? China Great God early in the domestic build a good site , and the content of the original site of exactly the same , we only need to point to our pip domestic sources like , I also regret the late ah know , harm , I stepped on so many pit. That we do not talk nonsense, just start it ~

/ 3 source exchange process /

1) Domestic source list

First of all domestic first list what those sites, usually 5 can be used, others I have not tried.

640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1

2) How to change the source

Many online tutorial on changing sources, most of them are what the new folder a file by file in the C drive, and then copy some things to enter. But I feel, still a little trouble , we required a large Python is simple , convenient. This uses the method of reader comments, very concise, as detailed below.

We only need a simple command ↓

pip config set global.index-url 源链接

Take Tsinghua source, we just need to execute ↓

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/

640?wx_fmt=jpeg&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1

    Let's look at our speed, as shown below:

640?wx_fmt=jpeg&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1

    Source address has changed, the speed Leverage, how, uncomfortable, right?

640?wx_fmt=jpeg&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1

/ 4 Summary /

This article mainly related to two points, one is introduced domestic source list, there are five, as detailed in the text; the second is the example of the change permanent source command:

pip config set global.index-url source link

Tsinghua source Examples

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/

    We only need to remember, OK, you want to try a lot of Oh! Thank concept watch, Xie Xie support!


Guess you like

Origin blog.51cto.com/13389043/2482892