herrkaefer / psycopgr

A Python wrapper of pgRouting for routing from nodes to nodes on real map.
MIT License
28 stars 7 forks source link

pip installation issues #12

Closed YakPort closed 4 years ago

YakPort commented 4 years ago

Hi I am having an issue installing using pip I get this error:

ERROR: Cannot unpack file /private/var/folders/yf/8xllz8194gj8hdb73qv7yljm0000gn/T/pip-unpack-e35fc8cw/psycopgr.git (downloaded from /private/var/folders/yf/8xllz8194gj8hdb73qv7yljm0000gn/T/pip-req-build-gqonsklh, content-type: text/html; charset=utf-8); cannot detect archive format ERROR: Cannot determine archive format of /private/var/folders/yf/8xllz8194gj8hdb73qv7yljm0000gn/T/pip-req-build-gqonsklh

I am using python 3.6.8 & psycopg2-binary==2.8.4

I am hoping to use with GeoDjango to calculate driving distances.

Many thanks for your help

herrkaefer commented 4 years ago

I can't reproduce your issue here. What platform are you using?

YakPort commented 4 years ago

Hi Thank you for your prompt reply I am using Python 3.6.8, Postgresql 12, PostGIS 3.0.1 and MacOS catalina 10.15.6 I have figured it out and will document it for other users.

1 warning generated. gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120004 -DHAVE_LO64=1 -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/xid_type.c -o build/temp.macosx-10.9-x86_64-3.8/psycopg/xid_type.o gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120004 -DHAVE_LO64=1 -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/adapter_asis.c -o build/temp.macosx-10.9-x86_64-3.8/psycopg/adapter_asis.o gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120004 -DHAVE_LO64=1 -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/adapter_binary.c -o build/temp.macosx-10.9-x86_64-3.8/psycopg/adapter_binary.o gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120004 -DHAVE_LO64=1 -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/adapter_datetime.c -o build/temp.macosx-10.9-x86_64-3.8/psycopg/adapter_datetime.o gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120004 -DHAVE_LO64=1 -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/adapter_list.c -o build/temp.macosx-10.9-x86_64-3.8/psycopg/adapter_list.o gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120004 -DHAVE_LO64=1 -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/adapter_pboolean.c -o build/temp.macosx-10.9-x86_64-3.8/psycopg/adapter_pboolean.o gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120004 -DHAVE_LO64=1 -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/adapter_pdecimal.c -o build/temp.macosx-10.9-x86_64-3.8/psycopg/adapter_pdecimal.o gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120004 -DHAVE_LO64=1 -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/adapter_pint.c -o build/temp.macosx-10.9-x86_64-3.8/psycopg/adapter_pint.o gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120004 -DHAVE_LO64=1 -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/adapter_pfloat.c -o build/temp.macosx-10.9-x86_64-3.8/psycopg/adapter_pfloat.o gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120004 -DHAVE_LO64=1 -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/adapter_qstring.c -o build/temp.macosx-10.9-x86_64-3.8/psycopg/adapter_qstring.o gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120004 -DHAVE_LO64=1 -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/microprotocols.c -o build/temp.macosx-10.9-x86_64-3.8/psycopg/microprotocols.o gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120004 -DHAVE_LO64=1 -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/microprotocols_proto.c -o build/temp.macosx-10.9-x86_64-3.8/psycopg/microprotocols_proto.o In file included from psycopg/microprotocols_proto.c:28: In file included from ./psycopg/psycopg.h:38: ./psycopg/config.h:82:13: warning: unused function 'Dprintf' [-Wunused-function] static void Dprintf(const char *fmt, ...) {} ^ 1 warning generated. gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120004 -DHAVE_LO64=1 -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/typecast.c -o build/temp.macosx-10.9-x86_64-3.8/psycopg/typecast.o gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.8/psycopg/psycopgmodule.o build/temp.macosx-10.9-x86_64-3.8/psycopg/green.o build/temp.macosx-10.9-x86_64-3.8/psycopg/pqpath.o build/temp.macosx-10.9-x86_64-3.8/psycopg/utils.o build/temp.macosx-10.9-x86_64-3.8/psycopg/bytes_format.o build/temp.macosx-10.9-x86_64-3.8/psycopg/libpq_support.o build/temp.macosx-10.9-x86_64-3.8/psycopg/win32_support.o build/temp.macosx-10.9-x86_64-3.8/psycopg/solaris_support.o build/temp.macosx-10.9-x86_64-3.8/psycopg/aix_support.o build/temp.macosx-10.9-x86_64-3.8/psycopg/connection_int.o build/temp.macosx-10.9-x86_64-3.8/psycopg/connection_type.o build/temp.macosx-10.9-x86_64-3.8/psycopg/cursor_int.o build/temp.macosx-10.9-x86_64-3.8/psycopg/cursor_type.o build/temp.macosx-10.9-x86_64-3.8/psycopg/column_type.o build/temp.macosx-10.9-x86_64-3.8/psycopg/replication_connection_type.o build/temp.macosx-10.9-x86_64-3.8/psycopg/replication_cursor_type.o build/temp.macosx-10.9-x86_64-3.8/psycopg/replication_message_type.o build/temp.macosx-10.9-x86_64-3.8/psycopg/diagnostics_type.o build/temp.macosx-10.9-x86_64-3.8/psycopg/error_type.o build/temp.macosx-10.9-x86_64-3.8/psycopg/conninfo_type.o build/temp.macosx-10.9-x86_64-3.8/psycopg/lobject_int.o build/temp.macosx-10.9-x86_64-3.8/psycopg/lobject_type.o build/temp.macosx-10.9-x86_64-3.8/psycopg/notify_type.o build/temp.macosx-10.9-x86_64-3.8/psycopg/xid_type.o build/temp.macosx-10.9-x86_64-3.8/psycopg/adapter_asis.o build/temp.macosx-10.9-x86_64-3.8/psycopg/adapter_binary.o build/temp.macosx-10.9-x86_64-3.8/psycopg/adapter_datetime.o build/temp.macosx-10.9-x86_64-3.8/psycopg/adapter_list.o build/temp.macosx-10.9-x86_64-3.8/psycopg/adapter_pboolean.o build/temp.macosx-10.9-x86_64-3.8/psycopg/adapter_pdecimal.o build/temp.macosx-10.9-x86_64-3.8/psycopg/adapter_pint.o build/temp.macosx-10.9-x86_64-3.8/psycopg/adapter_pfloat.o build/temp.macosx-10.9-x86_64-3.8/psycopg/adapter_qstring.o build/temp.macosx-10.9-x86_64-3.8/psycopg/microprotocols.o build/temp.macosx-10.9-x86_64-3.8/psycopg/microprotocols_proto.o build/temp.macosx-10.9-x86_64-3.8/psycopg/typecast.o -L/usr/local/lib -lpq -lssl -lcrypto -o build/lib.macosx-10.9-x86_64-3.8/psycopg2/_psycopg.cpython-38-darwin.so ld: library not found for -lssl clang: error: linker command failed with exit code 1 (use -v to see invocation) error: command 'gcc' failed with exit status 1

The problem is: ld: library not found for -lssl After some googling I came across this post: https://stackoverflow.com/questions/27264574/import-psycopg2-library-not-loaded-libssl-1-0-0-dylib a previous post suggested that I needed to install openssl using homebrew, however I had it already installed. Turns out it is a symlink issue and this fixed it for me pip install --global-option=build_ext \ --global-option="-I/usr/local/opt/openssl/include" \ --global-option="-L/usr/local/opt/openssl/lib" psycopg2

after that pip install psycopgr worked like a charm Thank you for your help, hope this helps someone