程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

One minute to learn how to install and use PIP in Python

編輯:Python

List of articles

  • One 、 Brief introduction
  • Two 、 Download and install
  • 3、 ... and 、 The most common command
    • 1、 Show version and path
    • 2、 get help
    • 3、 upgrade pip
    • 4、 Installation package
    • 5、 Upgrade package
    • 6、 Uninstall package
    • 7、 Search package
    • 8、 Show installation package information
    • 9、 List installed packages
    • 10、 View the details of the specified package

One 、 Brief introduction

pip yes Python Package management tools , The tool provides the right Python Bag search 、 download 、 Installed and uninstalled features , Now all the packages we use are either self-contained or through pip Installed .Python 2.7.9 + or Python 3.4+ All of the above versions come with pip Tools . give pip The website links :pip Official website .

Two 、 Download and install

By command pip --version To determine if... Is installed :

If you haven't already installed , You can use the following two methods to install :

1、Python With a ensurepip modular , Can be in Python Installation in the environment pip.cmd Enter the following command

py -m ensurepip --upgrade

2、 You can also download one Python Script , Use command line boot logic to install pip.

  1. Download script To your Python Under the folder

  2. win+cmd Open the terminal , Switch to your script Directory

  3. Enter the command enter

    py get-pip.py

3、 ... and 、 The most common command

1、 Show version and path

pip --version

2、 get help

pip --help

3、 upgrade pip

pip install -U pip

ps: Upgrade with caution , Often see pip Remind to upgrade , Then enter the command enter , The system starts to download the latest installation package ,
Uninstalled the previous version before preparing to install pip, Then the new version reported an error and could not be installed , Had to reload .

4、 Installation package

pip install SomePackage # The latest version
pip install SomePackage==1.0.4 # Specify the version
pip install ‘SomePackage>=1.0.4’ # Minimum version

For example, I want to install sklearn, Input pip install sklearn, The latest version of the package will be installed

5、 Upgrade package

pip install --upgrade SomePackage

 Upgrade the specified package , By using ==, >=, <=, >, < To specify a version number .

6、 Uninstall package

pip uninstall SomePackage

7、 Search package

pip search SomePackage

8、 Show installation package information

pip show SomePackage

9、 List installed packages

pip list

10、 View the details of the specified package

pip show -f SomePackage

In the conversation with a fan, I know that she has asked many official account and bloggers , But I was the only one who returned to her and helped her . He also sent a long paragraph to thank me , I also replied politely to her , She also mentioned that it was not easy to find my blog , And it's free and open source . Free resource sharing 、 Helping others for free has always been my original intention , I don't care if others charge , Or paid columns or paid resources , In short, I do my own , Everyone shines in his own field !


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved