How To Install Psycopg2 For Python2.6 When There Is Also 2.7 Installed?
I tried to install psycopg2 for python2.6 but my system also has 2.7 installed. I did >sudo -E pip install psycopg2 Downloading/unpacking psycopg2 Downloading psycopg2-2.5.3.t
Solution 1:
As per this answer, I installed pip2.6. Then I installed psycopg2
using the pip2.6
command and not pip like before:
sudo -E pip2.6 install psycopg2
Then it all worked
Solution 2:
Use python virtualenvs.
Virtualenv is a box for python and bunch of packages. So instead of makins your system a mess by mixing python and system packages you are doing like this.
$ virtualenv my_env26 -p python2.6$ . my_env26/bin/activate$ pip install whatever_i_want
$ virtualenv my_env27 -p python2.7$ . my_env27/bin/activate$ pip install another_packages
In that way you can have python environment with packages per project/per python version or grouped in any way you want. Profit is that you can remove this folder whenever you want very easly. It's harder when you mix system and python packages.
Post a Comment for "How To Install Psycopg2 For Python2.6 When There Is Also 2.7 Installed?"