To update an old system I had to compile python 2.7.14 with custom openssl version. The compiled system has no virtualenv binary and also neither pip nor easy_install for extension. How can I get virtualenv for the compiled version? How about pip?
Asked
Active
Viewed 1,292 times
2 Answers
3
From the docs on installing packages at https://packaging.python.org/tutorials/installing-packages/#ensure-you-can-run-pip-from-the-command-line there is a section on ensuring pip by running
/path_to_compiled_python/bin/python -m ensurepip --default-pip
which will install pip. You can then use it to install the virtualenv package with
/path_to_compiled_python/bin/pip install virtualenv

a1an
- 447
- 2
- 7
- 17
0
The steps that helped to setup a custom version of Python with a virtual environment without doing system wide installation.
Install dependencies:
sudo apt update
sudo apt install libssl-dev openssl g++ # and possibly more.
Get Python and build it:
wget https://www.python.org/ftp/python/3.8.8/Python-3.8.8.tgz
tar xzvf Python-3.8.8.tgz
cd Python-3.8.8
./configure
make
Install "pip" to "~/.local/lib/python3.8/site-packages":
./python -m ensurepip --default-pip
./python -m pip install --upgrade pip
Setup the virtual environment:
# Creates a directory "./python3.8-env".
./python -m venv python3.8-env
Activate the virtual environment and install other packages.
source python3.8-env/bin/activate
pip install --upgrade pip
pip install <package>

nvd
- 101
- 2