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 use python pip

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly explains "how to use python pip". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to use python pip.

Instructions before reading

Pip needs to be used at the command prompt, which can be used at the common Windows powershell,cmd command prompt or terminal in IDE. Take the command prompt as an example.

Press WIN + R to open and run, enter cmd and click OK to open the command prompt.

Third-party library search

Pip search package name. For example, pip search

Note: this directive shuts down the PYPI indefinitely for some reason. So the use of this instruction will report an error.

Download of the third party library

Pip download package name, for example, pip download selenium.

After the download is completed, you will be given a storage path, you can go to this path to view the downloaded library.

Installation of third-party libraries

Online installation: pip install package name, such as pip install selenium.

Install using the downloaded package: pip install file pathname, such as pip install c:\ users\ numpy-1.20.3-cp38-cp38-win_amd64.whl.

Note: you need to know the path of the package in advance.

Installed third-party library list display

Pip list

Information display of third-party library

Pip show package name, for example, pip show selenium.

Third-party library unloading

Pip uninstall package name, for example, pip uninstall selenium.

Pip help

Pip help or pip-h or pip-- help.

Temporary use of domestic sources

Follow the pip instruction with the parameter-I, for example:

Pip install numpy-I https://pypi.tuna.tsinghua.edu.cn/simple/

If you use the https protocol to transfer data, you can choose this instruction

Pip install ipython-I http://pypi.douban.com/simple/--trusted-host pypi.douban.com

Because the http protocol is not trusted, the source that uses the protocol needs to add-- trusted-host to indicate trust

Global configuration uses domestic sources

Create a pip folder under the C disk user folder, and then add a pip.ini file under the folder, the contents of which are as follows.

# Global configure Tsinghua source [global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple# source that uses http protocol. Add the following [install] trusted-host = https://pypi.tuna.tsinghua.edu.cn# trusted-host this parameter is to avoid trouble, otherwise you may be prompted not to be trusted.

Similar to temporary use, if you use the http protocol, you add the trusted-host parameter.

Thank you for your reading, the above is the content of "how to use python pip", after the study of this article, I believe you have a deeper understanding of how to use python pip, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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

Development

Wechat

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

12
Report