Can't install psycopg2 package through pip install… Is this because of Sierra?

后端 未结 13 1168
逝去的感伤
逝去的感伤 2020-11-28 01:35

I am working on a project for one of my lectures and I need to download the package psycopg2 in order to work with the postgresql database in use. Unfortunately, when I try

13条回答
  •  醉话见心
    2020-11-28 02:32

    brew install postgresql
    

    If postgresql exist then run:

    brew upgrade postgresql
    sudo pip install psycopg2
    

    In venv:

    env LDFLAGS='-L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib' pip install psycopg2==2.8.4
    

    If you need use only the command pip install psycopg2 export the path in macOSX:

    export LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib"
    

提交回复
热议问题