On a mac with:
After creating a new python2 or python3 venv, and installing with pip install psycopg2 -v, I receive the following error while it tries to build a wheel:
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.11-x86_64-3.5/psycopg/psycopgmodule.o build/temp.macosx-10.11-x86_64-3.5/psycopg/green.o build/temp.macosx-10.11-x86_64-3.5/psycopg/pqpath.o build/temp.macosx-10.11-x86_64-3.5/psycopg/utils.o build/temp.macosx-10.11-x86_64-3.5/psycopg/bytes_format.o build/temp.macosx-10.11-x86_64-3.5/psycopg/connection_int.o build/temp.macosx-10.11-x86_64-3.5/psycopg/connection_type.o build/temp.macosx-10.11-x86_64-3.5/psycopg/cursor_int.o build/temp.macosx-10.11-x86_64-3.5/psycopg/cursor_type.o build/temp.macosx-10.11-x86_64-3.5/psycopg/diagnostics_type.o build/temp.macosx-10.11-x86_64-3.5/psycopg/error_type.o build/temp.macosx-10.11-x86_64-3.5/psycopg/lobject_int.o build/temp.macosx-10.11-x86_64-3.5/psycopg/lobject_type.o build/temp.macosx-10.11-x86_64-3.5/psycopg/notify_type.o build/temp.macosx-10.11-x86_64-3.5/psycopg/xid_type.o build/temp.macosx-10.11-x86_64-3.5/psycopg/adapter_asis.o build/temp.macosx-10.11-x86_64-3.5/psycopg/adapter_binary.o build/temp.macosx-10.11-x86_64-3.5/psycopg/adapter_datetime.o build/temp.macosx-10.11-x86_64-3.5/psycopg/adapter_list.o build/temp.macosx-10.11-x86_64-3.5/psycopg/adapter_pboolean.o build/temp.macosx-10.11-x86_64-3.5/psycopg/adapter_pdecimal.o build/temp.macosx-10.11-x86_64-3.5/psycopg/adapter_pint.o build/temp.macosx-10.11-x86_64-3.5/psycopg/adapter_pfloat.o build/temp.macosx-10.11-x86_64-3.5/psycopg/adapter_qstring.o build/temp.macosx-10.11-x86_64-3.5/psycopg/microprotocols.o build/temp.macosx-10.11-x86_64-3.5/psycopg/microprotocols_proto.o build/temp.macosx-10.11-x86_64-3.5/psycopg/typecast.o -L/usr/local/Cellar/postgresql94/9.4.9_1/lib -lpq -lssl -lcrypto -o build/lib.macosx-10.11-x86_64-3.5/psycopg2/_psycopg.cpython-35m-darwin.so
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
If you look at the end of the link command, you will see that -L/usr/local/opt/openssl/lib is missing.
What is weirder, is that this install works on some coworkers Macs and not others. If looked at the setup.py file for your project, in particular the psycopg_build_ext class, but I don't see how the library is passing along its location.
Just as a data point, if I run python setup.py build_ext -v -L /usr/local/Cellar/openssl/1.0.2j/lib it successfully links.
Do you have any ideas on what might be going on here?
Many thanks!
psycopg2-macos-build-output.txt
I can't fix your specific problem. It will be fixed releasing OSX wheels (ticket #479). If you can provide help with that bug you are very welcome.
@mojochao There is now this project to build binary wheels on Travis CI: https://github.com/psycopg/psycopg2-wheels If you can contribute building wheels for OSX it would be great.
We had some luck doing this before the pip install export LDFLAGS="-L/usr/local/opt/openssl/lib" but haven't figured out why this happened on a fresh Sierra installed MBP.
I have uploaded some test OSX wheels package on testpypi. Could you please check if they work?
pip install -i https://testpypi.python.org/pypi psycopg2==2.7b1
Thank you very much.
@jkemp101 this saved me so much time! thank you!
This still saves time)) !
Downgrade to 2.7.7, it's the latest stable release
Most helpful comment
We had some luck doing this before the pip install
export LDFLAGS="-L/usr/local/opt/openssl/lib"but haven't figured out why this happened on a fresh Sierra installed MBP.