pycopg2 build problems

philip at semanchuk.com philip at semanchuk.com
Wed Sep 23 17:14:59 EDT 2009


Quoting Wolodja Wentland <wentland at cl.uni-heidelberg.de>:

> On Wed, Sep 23, 2009 at 12:24 -0700, devaru wrote:
>> I'm trying to install psycopg2 on my system. I followed the
>> instruction in INSTALL file and gave the command
>> python setup.py build
>> running build
>> running build_py
>> running build_ext
>> error: No such file or directory
>
> I ran into this some days ago. The problem is not related to the
> distribution you downloaded, but to missing information about PostgreSQL
> itself.
>
> IIRC the file in question is "/usr/bin/pg_config". The file is   
> probably packaged
> in some lib*-dev package on your distribution.

That's the most common install problem with psycopg2 -- setup.py can't  
find (or execute) pg_config which it needs to decide how to talk to  
Postgres. I remember it giving a different (and more descriptive)  
error but I haven't used psycopg2 recently.

To the OP: if executing pg_config fails from the same command line in  
which you're running setup.py, then Wolodja is absolutely correct. You  
need to get pg_config on your path somewhere, or there might be an  
environment variable you can set to tell setup where to find it if you  
don't want it in your path.

Good luck
Philip


>
> --- Debian example ---
> $ apt-file search /usr/bin/pg_config
> libpq-dev: /usr/bin/pg_config
> --- snip ---
>
> thanks for all the fish
>
>     Wolodja
>






More information about the Python-list mailing list