Installing psycopg2 fails on MacOS with unclear error message

后端 未结 3 1772
花落未央
花落未央 2021-02-01 08:04

Trying to install psycopg2 using pip 19.1 on MacOS 10.14.4 returns the lengthy error message below. I understand there are warnings related to gcc, but given the actual error me

3条回答
  •  孤城傲影
    2021-02-01 08:42

    I had this problem running pip install psycopg2 while I was running OSX 10.14.6. I fixed it by running this simple command:

    1. sudo ln -s /Applications/Postgres.app/Contents/Versions/latest/bin/pg_config /usr/local/bin/pg_config

    2. it asked for my password

    3. ln: /usr/local/bin/pg_config: File exists( than this appeared)

    4. export PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH"

    (then I ran the command above)

    1. python pip install pyscopg2 .

    (than i ran the code above. keep in mind I'm running python 3.7 in my virtual environment and I don't have to use python3 pip3 install pyscopg2.)

    6.Successfully installed psycopg2-2.8.4

提交回复
热议问题