pg_config executable not found

后端 未结 30 2428
渐次进展
渐次进展 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条回答
  •  Happy的楠姐
    2020-11-22 16:33

    Ali's solution worked for me but I was having trouble finding the bin folder location. A quick way to find the path on Mac OS X is to open psql (there's a quick link in the top menu bar). This will open a separate terminal window and on the second line the path of your Postgres installation will appear like so:

    My-MacBook-Pro:~ Me$ /Applications/Postgres93.app/Contents/MacOS/bin/psql ; exit;
    

    Your pg_config file is in that bin folder. Therefore, before installing psycopg2 set the path of the pg_config file:

    PATH=$PATH:/Applications/Postgres93.app/Contents/MacOS/bin/
    

    or for newer version:

    PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.3/bin
    

    Then install psycopg2.

提交回复
热议问题