当前位置: 首页 > 知识库问答 >
问题:

在安装了PostgreSQL 12.1的MacOS catalina上,在virtualenv中安装psycopg2有问题吗?

乜璞瑜
2023-03-14

我收到这样的信息:

Collecting psycopg2
  Using cached https://files.pythonhosted.org/packages/84/d7/6a93c99b5ba4d4d22daa3928b983cec66df4536ca50b22ce5dcac65e4e71/psycopg2-2.8.4.tar.gz
Building wheels for collected packages: psycopg2
  Building wheel for psycopg2 (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/mohsen/.virtualenvs/jalas-env/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/vh/0_hbs48171574k5y9pb97st80000gn/T/pip-install-y72dxnyb/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/vh/0_hbs48171574k5y9pb97st80000gn/T/pip-install-y72dxnyb/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/vh/0_hbs48171574k5y9pb97st80000gn/T/pip-wheel-51dm_zyp --python-tag cp37
       cwd: /private/var/folders/vh/0_hbs48171574k5y9pb97st80000gn/T/pip-install-y72dxnyb/psycopg2/
  Complete output (144 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.15-x86_64-3.7
  creating build/lib.macosx-10.15-x86_64-3.7/psycopg2
  copying lib/_json.py -> build/lib.macosx-10.15-x86_64-3.7/psycopg2
  copying lib/extras.py -> build/lib.macosx-10.15-x86_64-3.7/psycopg2
  copying lib/compat.py -> build/lib.macosx-10.15-x86_64-3.7/psycopg2
  copying lib/errorcodes.py -> build/lib.macosx-10.15-x86_64-3.7/psycopg2
  copying lib/tz.py -> build/lib.macosx-10.15-x86_64-3.7/psycopg2
  copying lib/_range.py -> build/lib.macosx-10.15-x86_64-3.7/psycopg2
  copying lib/_ipaddress.py -> build/lib.macosx-10.15-x86_64-3.7/psycopg2
  copying lib/_lru_cache.py -> build/lib.macosx-10.15-x86_64-3.7/psycopg2
  copying lib/__init__.py -> build/lib.macosx-10.15-x86_64-3.7/psycopg2
  copying lib/extensions.py -> build/lib.macosx-10.15-x86_64-3.7/psycopg2
  copying lib/errors.py -> build/lib.macosx-10.15-x86_64-3.7/psycopg2
  copying lib/sql.py -> build/lib.macosx-10.15-x86_64-3.7/psycopg2
  copying lib/pool.py -> build/lib.macosx-10.15-x86_64-3.7/psycopg2
  running build_ext
  building 'psycopg2._psycopg' extension
  creating build/temp.macosx-10.15-x86_64-3.7
  creating build/temp.macosx-10.15-x86_64-3.7/psycopg
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/psycopgmodule.o
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/green.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/green.o
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/pqpath.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/pqpath.o
  psycopg/pqpath.c:135:17: warning: implicit conversion from enumeration type 'ConnStatusType' to different enumeration type 'ExecStatusType' [-Wenum-conversion]
                  PQstatus(conn->pgconn) : PQresultStatus(*pgres)));
                  ^~~~~~~~~~~~~~~~~~~~~~
  psycopg/pqpath.c:1714:11: warning: code will never be executed [-Wunreachable-code]
      ret = 1;
            ^
  psycopg/pqpath.c:1819:17: warning: implicit conversion from enumeration type 'ConnStatusType' to different enumeration type 'ExecStatusType' [-Wenum-conversion]
                  PQstatus(curs->conn->pgconn) : PQresultStatus(curs->pgres)));
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  3 warnings generated.
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/utils.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/utils.o
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/bytes_format.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/bytes_format.o
  In file included from psycopg/bytes_format.c:81:
  In file included from ./psycopg/psycopg.h:37:
  ./psycopg/config.h:81:13: warning: unused function 'Dprintf' [-Wunused-function]
  static void Dprintf(const char *fmt, ...) {}
              ^
  1 warning generated.
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/libpq_support.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/libpq_support.o
  In file included from psycopg/libpq_support.c:29:
  In file included from ./psycopg/psycopg.h:37:
  ./psycopg/config.h:81:13: warning: unused function 'Dprintf' [-Wunused-function]
  static void Dprintf(const char *fmt, ...) {}
              ^
  1 warning generated.
  .
  .
  .
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/diagnostics_type.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/diagnostics_type.o
  In file included from psycopg/diagnostics_type.c:27:
  In file included from ./psycopg/psycopg.h:37:
  ./psycopg/config.h:81:13: warning: unused function 'Dprintf' [-Wunused-function]
  static void Dprintf(const char *fmt, ...) {}
              ^
  1 warning generated.
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/error_type.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/error_type.o
  In file included from psycopg/error_type.c:27:
  In file included from ./psycopg/psycopg.h:37:
  ./psycopg/config.h:81:13: warning: unused function 'Dprintf' [-Wunused-function]
  static void Dprintf(const char *fmt, ...) {}
              ^
  1 warning generated.
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/conninfo_type.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/conninfo_type.o
  In file included from psycopg/conninfo_type.c:27:
  In file included from ./psycopg/psycopg.h:37:
  ./psycopg/config.h:81:13: warning: unused function 'Dprintf' [-Wunused-function]
  static void Dprintf(const char *fmt, ...) {}
              ^
  1 warning generated.
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/lobject_int.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/lobject_int.o
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/lobject_type.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/lobject_type.o
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/notify_type.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/notify_type.o
  In file included from psycopg/notify_type.c:27:
  In file included from ./psycopg/psycopg.h:37:
  ./psycopg/config.h:81:13: warning: unused function 'Dprintf' [-Wunused-function]
  static void Dprintf(const char *fmt, ...) {}
              ^
  1 warning generated.
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/xid_type.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/xid_type.o
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/adapter_asis.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/adapter_asis.o
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/adapter_binary.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/adapter_binary.o
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/adapter_datetime.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/adapter_datetime.o
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/adapter_list.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/adapter_list.o
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/adapter_pboolean.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/adapter_pboolean.o
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/adapter_pdecimal.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/adapter_pdecimal.o
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/adapter_pint.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/adapter_pint.o
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/adapter_pfloat.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/adapter_pfloat.o
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/adapter_qstring.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/adapter_qstring.o
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/microprotocols.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/microprotocols.o
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/microprotocols_proto.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/microprotocols_proto.o
  In file included from psycopg/microprotocols_proto.c:27:
  In file included from ./psycopg/psycopg.h:37:
  ./psycopg/config.h:81:13: warning: unused function 'Dprintf' [-Wunused-function]
  static void Dprintf(const char *fmt, ...) {}
              ^
  1 warning generated.
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/typecast.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/typecast.o
  clang -bundle -undefined dynamic_lookup -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk build/temp.macosx-10.15-x86_64-3.7/psycopg/psycopgmodule.o build/temp.macosx-10.15-x86_64-3.7/psycopg/green.o build/temp.macosx-10.15-x86_64-3.7/psycopg/pqpath.o build/temp.macosx-10.15-x86_64-3.7/psycopg/utils.o build/temp.macosx-10.15-x86_64-3.7/psycopg/bytes_format.o build/temp.macosx-10.15-x86_64-3.7/psycopg/libpq_support.o build/temp.macosx-10.15-x86_64-3.7/psycopg/win32_support.o build/temp.macosx-10.15-x86_64-3.7/psycopg/solaris_support.o build/temp.macosx-10.15-x86_64-3.7/psycopg/connection_int.o build/temp.macosx-10.15-x86_64-3.7/psycopg/connection_type.o build/temp.macosx-10.15-x86_64-3.7/psycopg/cursor_int.o build/temp.macosx-10.15-x86_64-3.7/psycopg/cursor_type.o build/temp.macosx-10.15-x86_64-3.7/psycopg/column_type.o build/temp.macosx-10.15-x86_64-3.7/psycopg/replication_connection_type.o build/temp.macosx-10.15-x86_64-3.7/psycopg/replication_cursor_type.o build/temp.macosx-10.15-x86_64-3.7/psycopg/replication_message_type.o build/temp.macosx-10.15-x86_64-3.7/psycopg/diagnostics_type.o build/temp.macosx-10.15-x86_64-3.7/psycopg/error_type.o build/temp.macosx-10.15-x86_64-3.7/psycopg/conninfo_type.o build/temp.macosx-10.15-x86_64-3.7/psycopg/lobject_int.o build/temp.macosx-10.15-x86_64-3.7/psycopg/lobject_type.o build/temp.macosx-10.15-x86_64-3.7/psycopg/notify_type.o build/temp.macosx-10.15-x86_64-3.7/psycopg/xid_type.o build/temp.macosx-10.15-x86_64-3.7/psycopg/adapter_asis.o build/temp.macosx-10.15-x86_64-3.7/psycopg/adapter_binary.o build/temp.macosx-10.15-x86_64-3.7/psycopg/adapter_datetime.o build/temp.macosx-10.15-x86_64-3.7/psycopg/adapter_list.o build/temp.macosx-10.15-x86_64-3.7/psycopg/adapter_pboolean.o build/temp.macosx-10.15-x86_64-3.7/psycopg/adapter_pdecimal.o build/temp.macosx-10.15-x86_64-3.7/psycopg/adapter_pint.o build/temp.macosx-10.15-x86_64-3.7/psycopg/adapter_pfloat.o build/temp.macosx-10.15-x86_64-3.7/psycopg/adapter_qstring.o build/temp.macosx-10.15-x86_64-3.7/psycopg/microprotocols.o build/temp.macosx-10.15-x86_64-3.7/psycopg/microprotocols_proto.o build/temp.macosx-10.15-x86_64-3.7/psycopg/typecast.o -L/usr/local/lib -lpq -lssl -lcrypto -o build/lib.macosx-10.15-x86_64-3.7/psycopg2/_psycopg.cpython-37m-darwin.so
  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: Failed building wheel for psycopg2
  Running setup.py clean for psycopg2
Failed to build psycopg2

共有1个答案

颛孙兴旺
2023-03-14

我遇到了同样的问题,即ld:library找不到-lssl

但我已经安装了openSSL。因为对我来说,在运行PIP安装之前,按照https://github.com/brianmario/mysql2/issues/795#issuecomment-337006164设置以下内容

export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/
 类似资料:
  • 问题内容: 所以我试图在我的virtualenv中(在控制台中)运行一个简单的matplotlib示例。这是代码: 但是,当我运行它时,我得到: ImportError:Gtk *后端需要安装pygtk。 现在,乐趣开始了。我试图点安装pygtk,但它抛出: 我检查了文件并说尝试。然而。我不太确定如何在virtualenv中执行此操作。为了在virtualenv中安装pygtk,我在哪里解压缩源代

  • 我有一个错误: 当我在macOS而不是virtualenv中安装psycopg2时,这对我很有帮助:psycopg2 回答@zganger 但是,当我在Virtualenv2.7(venv)中时,什么都不起作用,甚至在那篇文章中也没有答案。我花了一周时间试图解决这个问题,但一点运气都没有。 我不知道我还能做什么。

  • 问题内容: 我正在遵循Heroku的教程来部署Django应用程序:http : //devcenter.heroku.com/articles/django#prerequisites。 一切正常,直到我涉及到这一部分: 我可以自己安装Django,但该探针与psycopg2一起使用。 我不断收到此错误: 我已经在机器上安装了PostgreSQL 9.1。 另外,在输出中,有很多这样的行: 我不

  • 我已经尝试了这里的一切- 但我似乎无法让它运作起来。无论何时我尝试npm安装——保存ursa,它都会失败。 我的错误是

  • 问题内容: 我正在使用MacOsX 10.6.4。 不久前,我遇到了Eclipse的问题(它不再启动-我在这里提出了一个问题,并遵循了所有建议,但没有运气)。然后,我也遇到了其他Java应用程序非常相似的问题,其中最后一个是android sdk。所有这些问题似乎与xerces / xml有关,如以下异常所示(仅运行tools / android并单击“可用更新”按钮): 线程“正在加载源”中的异

  • 我安装了JDK(我需要用IzPack编译),现在正在尝试找出哪个路径是我的JAVA_HOME变量的正确路径。 在/usr/lib/jvm中,我有以下内容: java-1.6.0-openjdk-amd64 java-6-openjdk-common java-6-openjdk-amd64 java-7-openjdk-amd64 null