Python PIP
- Previous Page Python RegEx
- Next Page Python Try Except
What is PIP?
PIP is the package manager for Python packages or modules.
Note:If you are using Python 3.4 or a higher version, PIP will be included by default.
What is a package (Package)?
The package contains all the files required by the module.
Modules are Python code libraries that you can include in your project.
Check if PIP is installed
Navigate to the location of the Python script directory using the command line, then type the following content:
Example
Check PIP version:
C:\Users\Your Name\AppData\Local\Programs\Python\Python36-32\Scripts>pip --version
Install PIP
If PIP has not been installed yet, you can download and install it from this page:https://pypi.org/project/pip/
Download the package
Downloading the package is very easy.
Open the command line interface and tell PIP to download the software package you need.
Navigate to the location of the Python script directory using the command line, then type the following content:
Example
Download the package named "camelcase":
C:\Users\Your Name\AppData\Local\Programs\Python\Python36-32\Scripts>pip install camelcase
Now, you have downloaded and installed your first package!
Use the package
After installing the package, you can use it.
Import the "camelcase" package into your project.
Example
Import and use "camelcase":
import camelcase c = camelcase.CamelCase() txt = "hello world" print(c.hump(txt))
search for packages
In https://pypi.org/, and you can find more packages.
Delete the package
Please use uninstall
Command to delete the package:
Example
Uninstall the package named "camelcase":
C:\Users\Your Name\AppData\Local\Programs\Python\Python36-32\Scripts>pip uninstall camelcase
The PIP package manager will ask you to confirm whether you need to delete the camelcase package:
Uninstalling camelcase-0.2: Would remove: c:\...\python\python36-32\lib\site-packages\camecase-0.2-py3.6.egg-info c:\...\python\python36-32\lib\site-packages\camecase\* Proceed (y/n)?
Press y
The package will be deleted if the key is used.
List packages
Please use list
Command to list all software packages installed on the system:
Example
List of installed packages:
C:\Users\Your Name\AppData\Local\Programs\Python\Python36-32\Scripts>pip list
Results:
Package Version ----------------------- camelcase 0.2 mysql-connector 2.1.6 pip 18.1 pymongo 3.6.1 setuptools 39.0.1
- Previous Page Python RegEx
- Next Page Python Try Except