From: | Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> |
---|---|
To: | Augori <augori(at)gmail(dot)com> |
Cc: | pgsql <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Trouble installing psycopg2 |
Date: | 2013-09-27 03:52:50 |
Message-ID: | 52450112.4090101@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 09/26/2013 07:07 PM, Augori wrote:
> I think Python 2.4 was installed with the OS. I installed Python 2.7
> from an .egg file that I downloaded. I'm a bit new to this
> terminology, so not sure if that considered Centos package management.
No.
>
> I think you're right about Python2.4 being set as the default. Does
> anyone know how to persuade it otherwise for installation purposes?
Well it seems you already have psycopg2 installed for Python 2.7, it
just cannot find it. Here is a possible solution.
Open the Python 2.7 shell
import sys
then
sys.path
This will show a list of paths that Python 2.7 knows about. Look to see
if /usr/local/lib/python2.7/site-packages/ is listed.
If not, you can temporarily include it by doing:
sys.path.append('/usr/local/lib/python2.7/site-packages/')
and then
import psycopg2
If it is indeed installed in /usr/local/lib/python2.7/site-packages/ it
should load.
To make the change 'permanent' create a *.pth file in one of the
directories shown when you first did sys.path, preferably a
site-packages one. In the file put
'/usr/local/lib/python2.7/site-packages/ . Then name the file, say
usr_local.pth. Python adds directories in *.pth files to the sys.path.
> Thanks.
>
--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | tuanhoanganh | 2013-09-27 04:53:58 | Re: PlPython with pyodbc error DLL load failed: A dynamic link library (DLL) initialization routine failed. |
Previous Message | John R Pierce | 2013-09-27 03:05:55 | Re: PlPython with pyodbc error DLL load failed: A dynamic link library (DLL) initialization routine failed. |