Fundamentals of Python: complete collection of pip commands

🌹 preface

Xiao Yuan began to update the Python series of teaching articles, which will get you started from scratch and look forward to your attention ❤️❤️
First article: Fundamentals of python (I): Python and vscode environment installation
Second article: Fundamentals of Python (II): necessary for getting started
The third article: Fundamentals of Python (3): operators
Article 4: Fundamentals of Python (4): data types
Article 5: Python Basics (V): basic statements
Article 6: Fundamentals of Python (6): Functions
Article 7: Fundamentals of Python (VII): review of advanced variable types
Article 8: Python Foundation (8): business card management system
Article 9: Fundamentals of Python (IX): Advanced variables
Article 10: Fundamentals of Python (10): advanced functions
Article 11: Fundamentals of Python (11): basic concepts of object orientation
Article 12: Fundamentals of Python (XII): classes and objects
Article 13: Fundamentals of Python (13): object oriented basic syntax
Article 14: Fundamentals of Python (XIV): private properties and private methods
Article 15: Fundamentals of Python (XV): Inheritance
Article 16: Fundamentals of Python (XVI): polymorphism
Article 17: Fundamentals of Python (17): class properties and class methods
Article 18: Fundamentals of Python (18): single example
Article 19: Python Basics (19): exceptions
Article 20: Fundamentals of Python (20): complete collection of pip commands
The second article: bloggers are stepping up their preparation

pip common commands

View the path of pip

where pip

View pip version

pip -V
pip --version

pip upgrade command

python -m pip install --upgrade pip

If the network connection of the default source of pip is poor, temporarily use this mirror station to upgrade:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U

Installation package

First:

pip install package_name  #Package here_ Name is the name of the third-party library to install

The second (recommended, faster download): use the domestic image source

pip install package_name -i http://mirrors.aliyun.com/pypi/simple/ 

Domestic image source

  • Alibaba cloud: http://mirrors.aliyun.com/pypi/simple/ (recommended)
  • Tsinghua University: https://pypi.tuna.tsinghua.edu.cn/simple
  • Watercress: http://pypi.douban.com/simple/

Third (specify package version number):

pip install package_name=Version number 

Fourth (local file installation):

  • Download package: https://pypi.org/

  • Search package name

  • Find the corresponding version

  • Click download

  • Download the corresponding whl file (my python version is 3.8, and my computer windows 64 bit)

  • Execute installation command

    pip install C:\Users\Administrator\Downloads\pymssql-2.2.2-cp38-cp38-win_amd64.whl #Followed by the package path and package name
    
  • Installation succeeded:

Global set mirror source address

It's too troublesome to add a domestic image address for each installation. You can set a fixed configuration

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

Uninstall package

pip uninstall package_name #Package here_ Name is the name of the third-party library to uninstall

Search package

pip search package_name

View all installed packages

pip list

View installation package details

pip show package_name

Update the specified package

pip install --upgrade package_name

View packages that need to be updated

pip list --outdated

view help

pip -h
pip --help

Usage:  
 pip<command>[options]
 
Commands:
 install                    Installation package.
 uninstall                  Uninstall package.
 freeze                     Output the list of installed packages in a certain format
 list                       List installed packages.
 show                       Show package details.
 search                     Search package, similar yum Inside search.
 wheel                      Buildwheelsfromyourrequirements.
 zip                        Not recommended.Zipindividualpackages.
 unzip                      Not recommended.Unzipindividualpackages.
 bundle                     Not recommended.Createpybundles.
 help                       Current help.
 
GeneralOptions:
 -h,--help                 Show help.
 -v,--verbose              More outputs can be used up to 3 times
 -V,--version              Real version information and exit.
 -q,--quiet                Minimum output.
 --log-file<path>          Record by overwriting verbose Error log, default file:/root/.pip/pip.log
 --log<path>               Do not overwrite records verbose Output log.
 --proxy<proxy>            Specifyaproxyintheform[user:passwd@]proxy.server:port.
 --timeout<sec>            Connection timeout(The default is 15 seconds).
 --exists-action<action>   Defaultactionwhenapathalreadyexists:(s)witch,(i)gnore,(w)ipe,(b)ackup.
 --cert<path>              certificate.

Error reporting problem

Error reporting for permission problem


Add -- trusted host mirrors aliyun. Com suffix

pip install pymssql -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

Keywords: Python Back-end

Added by barrylee on Tue, 04 Jan 2022 09:02:03 +0200