Python pip under Windows 10 quickly sets up the domestic mirror source

After reading many posts, the mess can't solve the problem. . .
pip download, because the default mirror source is abroad, some packages have a slow download speed, so you know,

How

Not much nonsense, just open the window that can run the pip terminal and enter two commands. Here is an example of setting up Tsinghua mirror.

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

>  pip config set install.trusted-host https://pypi.tuna.tsinghua.edu.cn

This will be automatically written into the configuration file.
If you want another mirror source, such as Alibaba Cloud

>  pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
>  pip config set install.trusted-host mirrors.aliyun.com

References

  • Look at this big guy https://zhuanlan.zhihu.com/p/106697938
  • What stuff https://www.jb51.net/article/193743.htm
  • I don't know what to say https://www.jianshu.com/p/3621780417be

Guess you like

Origin blog.csdn.net/weixin_43031092/article/details/108690238