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 install and use pip

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly shows you "how to install and use pip", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to install and use pip" this article.

Pip is a modern, universal Python package management tool. Provides the functions of finding, downloading, installing and uninstalling Python packages.

Currently, if you download the latest version of the installation package from python.org, you already have the tool with you.

Python 2.7.9 + or Python 3.4 + and above come with pip tools.

Pip official website: https://pypi.org/project/pip/

You can determine whether it is installed by the following command:

Pip-version

If you have not already installed it, you can use the following methods to install it:

$curl https://bootstrap.pypa.io/get-pip.py-o get-pip.py # download the installation script $sudo python get-pip.py # run the installation script

Note: which version of Python is used to run the installation script, pip is associated with that version, and if it is Python3, execute the following command:

$sudo python3 get-pip.py # run the installation script.

In general, pip corresponds to Python 2.7 and Python 3.x.

Some Linux distributions can install pip directly with the package manager, such as Debian and Ubuntu:

Sudo apt-get install python-pippip most commonly used commands

Show version and path

Pip-version

Get help

Pip-help

Upgrade pip

Pip install-U pip

If there is a problem with this upgrade command, you can use the following command:

Sudo easy_install-upgrade pip

Installation package

Pip install SomePackage# latest version pip install SomePackage==1.0.4# specified version pip install 'SomePackage > = 1.0.4 version # minimum version

For example, I want to install Django. It is convenient and quick to use one of the following commands.

Pip install Django==1.7

Upgrade package

Pip install-upgrade SomePackage

Upgrade the specified package, by using =, >,

Uninstall the package

Pip uninstall SomePackage

Search package

Pip search SomePackage

Display installation package information

Pip show

View the details of the specified package

Pip show-f SomePackage

List installed packages

Pip list

View upgradeable packages

Pip list-o considerations

If both Python2 and Python3 have pip, the method is as follows:

Python2:python2-m pip install XXXPython3:python3-m pip install XXX above is all the content of this article "how to install and use pip". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more 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

Development

Wechat

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

12
Report