Re: Trouble installing psycopg2

From: David Kerr <dmk(at)mr-paradox(dot)net>
To: Laura Tateosian <augori(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Trouble installing psycopg2
Date: 2013-09-26 18:19:27
Message-ID: 20130926181927.GA78826@mr-paradox.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Sep 26, 2013 at 01:01:54PM -0400, Laura Tateosian wrote:
- Hi, I'm trying to install psycopg2 on a Centos 5, 64-bit machine. I have
- both 2.4 and 2.7 Python versions on this machine. I attempted to install
- using
- easy-install2.7 psycopg2
-
- The install is not working. (I can't import psycopg2 in a python 2.7
- session). yum doesn't list it as installed. But when I try to install it
- again, easy_install responds that it's already installed. That's the short
- version of the problem, more details below that may or may not be helpful.
-
- Thanks,
- LT
-
-
-
-
- At first, easy-install2.7 psycopg2 gave me similar errors to what's
- described on this page:
- http://stackoverflow.com/questions/9600111/install-pg-config-in-centos-5-5-without-yum(something
- to do with pg_config not found). So I followed the advice of
- installing devel
-
- yum install postgresql84-devel
-
- ...succeeded.
-
- Then, I "easy-install2.7 psycopg2" again. In fact I piped the output to a
- file and got what I have below, but it also flashed up an error message
- which didn't get into this file and I can't see on the history. But from
- that second that I saw it, I know it had __FILE__ in it. Now I'm in this
- installed/but not installed kind of limbo.
- ...
- Excluding Packages in global exclude list
- Finished
- Available Packages
- python-psycopg2.x86_64 2.0.14-2.el5
- epel
- python-psycopg2-doc.x86_64 2.0.14-2.el5
- epel
- python-psycopg2-zope.x86_64 2.0.14-2.el5
- epel
- root(at)server [/opt/bin]# easy_install-2.7 psycopg2
- Searching for psycopg2
- Searching for psycopg2
- Reading http://pypi.python.org/simple/psycopg2/
- Reading http://initd.org/projects/psycopg2
- Best match: psycopg2 2.5.1
- Downloading
- https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.5.1
- .tar.gz#md5=1b433f83d50d1bc61e09026e906d84c7
- Processing psycopg2-2.5.1.tar.gz
- Writing /tmp/easy_install-UYNn1g/psycopg2-2.5.1/setup.cfg
- Running psycopg2-2.5.1/setup.py -q bdist_egg --dist-dir
- /tmp/easy_install-UYN
- n1g/psycopg2-2.5.1/egg-dist-tmp-FLKSTs
- Adding psycopg2 2.5.1 to easy-install.pth file
-
- Installed
- /usr/local/lib/python2.7/site-packages/psycopg2-2.5.1-py2.7-linux-x
- 86_64.egg
- Processing dependencies for psycopg2
- Finished processing dependencies for psycopg2

So easy_install isn't going to intall the yum version, and it may install it somewhere
that the system python isn't looking for it.

That's generally why you don't want to use easy_install or pip if you can avoid it.
If you DO use them you should use virtualenv and virtualenvwrapper.

Since you have an OS package, Your best bet is to do 'yum install python-psycopg2'
and see if that works for you.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chris Curvey 2013-09-26 18:23:29 Re: Trouble installing psycopg2
Previous Message Craig Boyd 2013-09-26 17:55:16 Re: Blowfish Encrypted String