Psycopg2: Fails to build 2.8.4

Created on 22 Oct 2019  ·  2Comments  ·  Source: psycopg/psycopg2

Hello,

I tried to install psycopg2==2.8.4 on OSX with Python 3.7.4 in a virtualenv.

Error log:

    ld: library not found for -lssl
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    error: command 'clang' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/{USER}/Code/entitlements_airflow_plugin/venv/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/7v/7q7v2wtd7nz3b8g_0d4fbt980000gp/T/pip-install-nh8t8y01/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/7v/7q7v2wtd7nz3b8g_0d4fbt980000gp/T/pip-install-nh8t8y01/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/7v/7q7v2wtd7nz3b8g_0d4fbt980000gp/T/pip-record-ozrld2km/install-record.txt --single-version-externally-managed --compile --install-headers /Users/{USER}/Code/entitlements_airflow_plugin/venv/bin/../include/site/python3.7/psycopg2 Check the logs for full command output.

Switched to psycopg2==2.8.3 and it installed like a charm.

I saw there is recently a change, so figured this report might be helpful.

I also had openssl installed through brew

(venv) ➜  openssl version
OpenSSL 1.0.2t  10 Sep 2019
(venv) ➜  which openssl
/usr/local/opt/openssl/bin/openssl

Most helpful comment

Had the same issue, even with 2.8.3 on Mac OS Catalina. Could fix it with installing openssl via brew install openssl

After that exporting Flags via:

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

Installation was successfull.

All 2 comments

Had the same issue, even with 2.8.3 on Mac OS Catalina. Could fix it with installing openssl via brew install openssl

After that exporting Flags via:

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

Installation was successfull.

Finding the libraries in non-standard locations is not something we can do automatically (unless you can in a way I'm not aware, for which a patch is welcome).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mattip picture mattip  ·  6Comments

ProgVal picture ProgVal  ·  3Comments

dvlhntr picture dvlhntr  ·  6Comments

camillehuot picture camillehuot  ·  4Comments

matthewapeters picture matthewapeters  ·  5Comments