- PIP stands for Python Package installer.
- PIP is a package manager for Python packages or modules.
- Pip is a package management system used to install and manage software packages written in Python.
- We can find Many packages in the default source for packages and their dependencies.
- Python Package installer. Python 2.7.9 and later, and Python 3.4 and later include pip by default.
- Open command prompt and type the following
>pip --version
If the above shows the pip version, then pip is already installed on your system.
Open the command prompt and type the following
>python -m pip install –upgrade pip
You can install packages in 2 different ways.
- Go to https://pypi.org
- Search required packages such as pandas, numpy, OpenCV.
- Now type in the terminal
>pip install pacakagename
- Which package name is showing in the website portal
- Just open https://pypi.org
- Search required packages such as pandas, numpy, OpenCV.
- Do to download section and download .whl file which is an archive for packages.
- Go to the download folder. And open command prompt their and type
>pip install downloaded_package.whl
Use the list command to list all the packages installed on your system: Example
>pip list
Use the uninstall command to remove a package:
Example
>pip uninstall pacakagename
- Save all the packages in the file with
Example:
>pip freeze >requirements.txt
Keep in mind that in this case, requirements.txt file will list all packages that have been installed in the system. So before creating any project first create an environment and run above command to list out required package name in requirements.txt
- first, go to the folder where requirements.txt file is placed and type the following command in terminal
Example:
>pip install -r requirements.txt