When using python,Often you need to download some third-party framework,Fortunately, python has a similar apt package management tool,pip。
but,Although management packs can pip,But no source switching mirror,And we downloaded package,Most of the large foreign code hosting server,This often leads to a few hundred KB of package to download one hour。
Here we assume that,As a programmer you,Have been deployed to the computer HTTPS and HTTP proxy,We also said before,How to set the global proxy to the terminal over the wall to let brew update,But do not eat that pip,This time we will be individually set to pip wall。
I checked on the Internet,There is an option pip pip3,Be called
1 2 |
--proxy <proxy> Specify a proxy in the form [user:passwd@]proxy.server:port. |
We use this direct command like,But this command requires each additional package when you download,For example, this:
1 |
pip3 --proxy 127.0.0.1:6152 install snowlp |
This is too much trouble,edit ~/.bashrc file,Or if you use zsh,It is ~/.zshrc ,Add at the end alias pip3="pip3 --proxy 127.0.0.1:6152" Such,Next time do not open the terminal after each input so long the Agent Options。
--Oh, right,Remember to port to port your own。
There is only supported Https Http proxy pip,Socks is not enough。?
Original article written by LogStudio:R0uter's Blog » Let go pip Agent
Reproduced Please keep the source and description link:https://www.logcg.com/archives/1914.html
Thanks,Solved my problem
Also found that a parameter to specify the source -i
-i https://pypi.douban.com/simple
The effect is good
I now use enhanced mode surge of,Realize the real global situation similar to vpn。