pg_config executable not found

后端 未结 30 2416
渐次进展
渐次进展 2020-11-22 15:42

I am having trouble installing psycopg2. I get the following error when I try to pip install psycopg2:

Error: pg_config executable not found.

P         


        
30条回答
  •  一整个雨季
    2020-11-22 16:08

    This is what worked for me on CentOS, first install:

    sudo yum install postgresql postgresql-devel python-devel
    

    On Ubuntu just use the equivilent apt-get packages.

    sudo apt-get install postgresql postgresql-dev python-dev
    

    And now include the path to your postgresql binary dir with you pip install, this should work for either Debain or RHEL based Linux:

    sudo PATH=$PATH:/usr/pgsql-9.3/bin/ pip install psycopg2
    

    Make sure to include the correct path. Thats all :)

提交回复
热议问题