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 configure the pip installation source

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces how to configure the pip installation source, which is very detailed and has a certain reference value. Friends who are interested must read it!

PyPI uses domestic sources

After using pip several times, the speed of the default pip source is really unbearable, so we collected some domestic pip sources, as follows:

Aliyun http://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

The use method is very simple, directly-I plus url can! As follows:

one

# pip install web.py-I http://pypi.douban.com/simple

If there is an error as follows:

Use the command:

one

# pip install web.py-I http://pypi.douban.com/simple-- trusted-host pypi.douban.com

If you want to configure it as the default source, the method is as follows:

Need to create or modify configuration files (usually created)

The file of linux is in ~ / .pip/pip.conf

Windows at% HOMEPATH%\ pip\ pip.ini)

Modify the content as follows:

[global] index-url = http://pypi.douban.com/simple[install]trusted-host=pypi.douban.com

This way, when installing using pip, the image will be called by default.

The python scripts that temporarily install packages from other sources are as follows:

one

two

three

four

five

six

seven

#! / usr/bin/python

Import os

Package = raw_input ("Please input the package which you want to install!\ n")

Command = "pip install% s-I http://pypi.mirrors.ustc.edu.cn/simple-trusted-host pypi.mirrors.ustc.edu.cn"% package

Os.system (command)

These are all the contents of the article "how to configure the pip installation Source". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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

Servers

Wechat

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

12
Report