How to Install Python Package Without Pip
In this article, we will learn how to install a library without pip in Python. We will also learn how to use the conda command
to install a package in Python.
Install Python Library Without pip
Command
In Python, the pip
command is the most often used method for installing open source libraries in our systems. However, there is another way to manually install Python libraries rather than the pip
command.
To install a Python library without using the pip
command, we need to download and install the package from pypi.org
and run the setup.py
file with Python.
This section covers the procedures to be followed before installing additional Python packages.
-
Go to Google and search pypi.org, and you will be redirected to the following page.
-
Suppose we want to install python packages
SciPy
. We will first write it in thesearch project
bar, and press Enter. -
We will get a list of different libraries and click on the library we want to install, and the first package on the list is the most relevant of them all. Select the first one,
scipy 1.9.1
, in our case. -
Once we click on the required package, we will be redirected to the next page. Click on the
download file
option to move to the further process of downloading the python package withoutpip
. -
After clicking on the
Download files
, we will see some links. If we want, we can go through them all, but if we want to install the package directly, we can click on the first link from theSource Distribution
. -
Once we click on the link, the installation of the python package SciPy will start without using the
pip
command. We will get a zip file of it. -
Once the installation is completed, we will click on the
show in folder
to move into the folder where we have installed the zip file.Now we are redirected to the folder where the zip file
scipy-1.9.1.tar
is available. -
We open the zipped folder and then drag files or folders to a new location to decompress them. We will hold down the zipped folder or click right, choose
Extract All
, and then follow the on-screen instructions to unzip the whole contents.We have all the files extracted into our system.
-
We will open the command prompt as administrator. Use the
cd command
to navigate our extracted directory.cd ['directory']
-
Run the setup.py file in Python using the command below.
python setup.py install
The necessary package must then be installed on our system after this. To check if the Python package is installed in the system or not, we open the cmd
prompt and import the package we want to check the availability.
import scipy
After this, we will check the version of the package.
scipy.__version__
This shows that scipy
is installed in the system.
Install Python Package With Conda
Command
We can also install python packages using conda
in the cmd
prompt.
conda install scipy
The conda
command installs all the requirements along with packages.
We can now utilize the installed libraries to import into our Python application.
My name is Abid Ullah, and I am a software engineer. I love writing articles on programming, and my favorite topics are Python, PHP, JavaScript, and Linux. I tend to provide solutions to people in programming problems through my articles. I believe that I can bring a lot to you with my skills, experience, and qualification in technical writing.
LinkedIn