. Advertisement .
. Advertisement .
The following short tutorial will guide you to install a package in Python using PIP. It also helps you uninstall this file if you no longer have to use it to free space for other data.
If your operating system is Windows, open the Windows Command Prompt, run the pip install package_name command to install a Python package.
However, this simple method will work for operations having Python to Windows path only. For those who don’t have, this article will give full steps with detailed examples.
What is PIP In Python?
PIP is a main manager for all Python modules and packages. Most Python versions at least 3.4 are manufactured with this function by default. You can check the installation state of PIP by navigating to the Python’s script directory location and run the following command:
C:\Users\Your Name\AppData\Local\Programs\Python\Python36-32\Scripts>pip --version
If you don’t have PIP on hand, you can install it by downloading the file from the official website.
On the other hand, a package stores all of a Python code library’s files. It is straightforward to download a package. All you have to do is open the command line interface and type the desired one in PIP.
C:\Users\Your Name\AppData\Local\Programs\Python\Python36-32\Scripts>pip install camelcase
The following part will explain the installation steps in detail.
How To Install A Package In Python Using PIP
- Step 1: In the Windows search box, run the Command Prompt to get your user name. It would be best to run it as an administrator to avoid permission problems.
- Step 2: Type “cd\” in the prompt box. This code makes sure that there is only a drive name in your starting point. Then press Enter to get the drive name:
- Step 3: Locate the path: You can find the Scripts folder in the application one. This application folder stays in the original Python installation place.
- Step 4: Run the “cd” command with your Scripts Path in the Command Prompt:
When pressing Enter, you will get the following result:
- Step 5: Install a Python package. The following command will executive and install your package:
pip install package_name
If you want to install a Pandas one, the command in the prompt would be pip install pandas.
- Step 6: Press Enter and get the notification of successful installation. You can open the Python IDLE and execute the import pandas command to have a quick check of your package.
Uninstall A Package With PIP
If you no longer have to work with the installed Python package, you can also make use of PIP to uninstall it. All you have to do is run the following command:
pip uninstall package_name
Yet, make sure to turn on the Python Scripts path.
PIP can install all third-packages, including Pygame, PyAutoGUI, and Matplotlib. On Windows, this function also helps install Python packages. The post has offered detailed steps to install a package in Python using PIP.