This article explains how to install Python libraries without using the pip command. Using the Python pip command is the most popular method for installing external libraries on your system. Nevertheless, installing Python libraries manually can also be done without the pip program.
Let us follow the method:
- Obtaining the files by downloading:
- Visit the https://pypi.org/ website to locate the installation package.
- Click the “Download Files” button from the menu on the left.
- Use a suitable library and download the “.tar.gz” file.
- Use any unzipping software to unzip the downloaded files if they have been compressed.
- Use the “cd” command to move the current working directory to the file containing “Setup.py”.
- Carefully read the installation instructions and follow the directions for installation.
- Type the following command after modifying the file containing Setup.py as the current working directory:
python setup.py install
This completes the installation of the library, which you may use by importing it into your Python program. Hope you grasped everything well.
To install and switch Python versions on Ubuntu 22.04, see our guide on How to Install and Switch Python Versions on Ubuntu 22.04