Installing Python2.6 in a virtual environment

First, install python2.6 executable. see previous post if you have issues when compiling (gcc not found).

Make sure you have installed python-dev with apt-get or yum.

Then, following the instructions on the same topic but for Python 3 in a virtualenv,

type:

 
virtualenv --python=/home/<user>/Software/Python2.6/mybuild/bin/python2.6 virtualenv2.6 --no-setuptools
cd virtualenv2.6

Note the usage of –no-setuptools option. I had error related to pip and setuptools that could not be installed.

So, now we need to install them manually, but before, let us activate the newly created virtualenv:

cd virtualenv2.6
source bin/activate

and now, let us download and install setuptools:

wget https://bootstrap.pypa.io/ez_setup.py -O - | python
unzip setuptools-5.6.zip 
cd setuptools-5.6/
python setup.py install

and finally, let us install pip

easy_install-2.6 pip

that’s it we are ready to use python2.6

Please follow and like us:
This entry was posted in Python, Software development and tagged , . Bookmark the permalink.

2 Responses to Installing Python2.6 in a virtual environment

  1. Luca says:

    Hey Thomas,have you tried Anaconda (and their conda manager) for this?? It works great!

Leave a Reply

Your email address will not be published.