Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to change pip source to domestic image

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "how to change the pip source to the domestic image". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "how to change the pip source to the domestic image"!

Some domestic images of pip

   Ali Cloud https://mirrors.aliyun.com/pypi/simple/

   https://pypi.mirrors.ustc.edu.cn/simple/ of University of Science and Technology of China

   douban http://pypi.douban.com/simple/

   https://pypi.tuna.tsinghua.edu.cn/simple/ of Tsinghua University

   http://pypi.mirrors.ustc.edu.cn/simple/ of University of Science and Technology of China

Modify the source method:

Temporary use:

You can specify the pip source by adding the-I parameter to the end when using pip

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

Permanent modification:

Linux:

Modify ~ / .pip/pip.conf (create one if you don't have one), as follows:

[global] index-url = https://pypi.tuna.tsinghua.edu.cn/simplecat ~ / .pip/ pip.conf.global] index-url = https://mirrors.aliyun.com/pypi/simple/[install]trusted-host=mirrors.aliyun.com

Windows:

Create a pip directory directly in the user directory, such as C:\ Users\ xx\ pip, and create a new file pip.ini, as follows

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

Erroneous deletion and recovery:

Curl https://bootstrap.pypa.io/get-pip.py-o get-pip.pyThen run the following:python get-pip.py

If it doesn't work, you can try to configure it directly under / etc

Vim / etc/ pip.conf.confglobal] no-binary = libvirt-pythonindex-url = http://mirrors.aliyun.com/pypi/simple/extra-index-url = https://pypi.douban.com/simpletimeout = 60 [install] trusted-host= http://mirrors.aliyun.com

If windows modifies the pip source

1. Open the appdata folder, enter% appdata% in the explorer's address bar and enter enter

two。 Create a new pip folder and a new configuration file pip.ini in the pip folder

3. Enter the following in the configuration file and save it.

[global]

Timeout = 6000

Index-url = https://pypi.tuna.tsinghua.edu.cn/simple

Trusted-host = pypi.tuna.tsinghua.edu.cn

At this point, I believe you have a deeper understanding of "how to change the pip source to the domestic image". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report