Bootstrap FreeKB - Python (Scripting) - Install module using setup.py
Python (Scripting) - Install module using setup.py

Updated:   |  Python (Scripting) articles

Almost always, pip install is used to install a package. However, there are some edge cases where it makes sense to install a package using the python setup.py install command. For example, I had a situation where I needed to create a virtual environment with Python version 2 but my Python version 2 did not have the virtualenv module.

~]# python -m virtualenv my_virtual_env
/usr/bin/python: No module named virtualenv

 

So I went over to https://pypi.org/project/virtualenv/ and downloaded virtualenv-20.23.0.tar.gz and placed this tar archive on my Linux system that had Python 2 and then used the tar extract command to extract the tar archive.

~]$ tar -zxpf /tmp/virtualenv-20.23.0.tar.gz --directory /tmp

 

And then ran the python setup.py install command to install the virtualenv module into Python 2.

cd /tmp/virtualenv-20.23.0
sudo python setup.py install

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 3a0544 in the box below so that we can be sure you are a human.