首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >pipenv错误:无法安装软件包: psycopg2

pipenv错误:无法安装软件包: psycopg2
EN

Stack Overflow用户
提问于 2022-10-14 09:29:56
回答 2查看 79关注 0票数 0

我在macOS蒙特利12.4上运行pipenv。我有以下Pipfile:

代码语言:javascript
复制
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"

[packages]
django = "<4.1"
pyparsing = "*"
pydot = "*"
django-extensions = "*"
coverage = "*"
djangorestframework = "~=3.13"
Markdown = "*"
django-nested-admin = "*"
drf-nested-routers = "*"
drf-access-policy = "~=1.0"
drf-yasg = "*"
drf-social-oauth2 = "*"
django-cors-headers = "*"
black = "*"
django-stubs = "*"
djangorestframework-stubs = "*"
dj-database-url = "*"
gunicorn = "*"
whitenoise = "*"
psycopg2-binary = "*"
psycopg2 = "*"
sentry-sdk = "*"
django-filter = "*"
django-hashid-field = "*"
channels = "~=3.0"
djangochannelsrestframework = "*"
celery = "==5.2.2"
django-celery-results = "==2.2.0"
channels-redis = "*"
requests = "*"
django-silk = "*"
django-auto-prefetching = "*"
drf-viewset-profiler = "*"
django-lifecycle = "*"
django-notifications-rest = "*"
django-notifications-hq = "*"
django-postgrespool2 = "*"

[dev-packages]
mypy = "*"

[requires]
python_version = "3.8"

到现在为止,这一切一直都很顺利。我试着运行命令:pipenv update sentry-sdk,这是输出:

代码语言:javascript
复制
(backend) samuelebonini@Samueles-MacBook-Pro-2 backend % pipenv update sentry-sdk
Locking [dev-packages] dependencies...
Building requirements...
Resolving dependencies...
✔ Success! 
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
✔ Success! 
Updated Pipfile.lock (a39560)!
Installing dependencies from Pipfile.lock (a39560)...
An error occurred while installing psycopg2==2.9.4 --hash=sha256:aa184d551a767ad25df3b8d22a0a62ef2962e0e374c04f6cbd1204947f540d61 --hash=sha256:07b90a24d5056687781ddaef0ea172fd951f2f7293f6ffdd03d4f5077801f426 --hash=sha256:aafa96f2da0071d6dd0cbb7633406d99f414b40ab0f918c9d9af7df928a1accb --hash=sha256:c7fa041b4acb913f6968fce10169105af5200f296028251d817ab37847c30184 --hash=sha256:8de6a9fc5f42fa52f559e65120dcd7502394692490c98fed1221acf0819d7797 --hash=sha256:849bd868ae3369932127f0771c08d1109b254f08d48dc42493c3d1b87cb2d308 --hash=sha256:46361c054df612c3cc813fdb343733d56543fb93565cff0f8ace422e4da06acb --hash=sha256:d529926254e093a1b669f692a3aa50069bc71faf5b0ecd91686a78f62767d52f --hash=sha256:a11946bad3557ca254f17357d5a4ed63bdca45163e7a7d2bfb8e695df069cc3a --hash=sha256:839f9ea8f6098e39966d97fcb8d08548fbc57c523a1e27a1f0609addf40f777c --hash=sha256:1da77c061bdaab450581458932ae5e469cc6e36e0d62f988376e9f513f11cb5c! Will try again.
     ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 16/16 — 00:00:05
Installing initially failed dependencies...
[pipenv.exceptions.InstallError]: Looking in indexes: https://pypi.python.org/simple
[pipenv.exceptions.InstallError]: Collecting psycopg2==2.9.4
[pipenv.exceptions.InstallError]:   Using cached psycopg2-2.9.4.tar.gz (384 kB)
[pipenv.exceptions.InstallError]:   Preparing metadata (setup.py): started
[pipenv.exceptions.InstallError]:   Preparing metadata (setup.py): finished with status 'done'
[pipenv.exceptions.InstallError]: Building wheels for collected packages: psycopg2
[pipenv.exceptions.InstallError]:   Building wheel for psycopg2 (setup.py): started
[pipenv.exceptions.InstallError]:   Building wheel for psycopg2 (setup.py): finished with status 'error'
[pipenv.exceptions.InstallError]:   Running setup.py clean for psycopg2
[pipenv.exceptions.InstallError]: Failed to build psycopg2
[pipenv.exceptions.InstallError]: Installing collected packages: psycopg2
[pipenv.exceptions.InstallError]:   Attempting uninstall: psycopg2
[pipenv.exceptions.InstallError]:     Found existing installation: psycopg2 2.9.3
[pipenv.exceptions.InstallError]:     Uninstalling psycopg2-2.9.3:
[pipenv.exceptions.InstallError]:       Successfully uninstalled psycopg2-2.9.3
[pipenv.exceptions.InstallError]:   Running setup.py install for psycopg2: started
[pipenv.exceptions.InstallError]:   Running setup.py install for psycopg2: finished with status 'error'
[pipenv.exceptions.InstallError]:   Rolling back uninstall of psycopg2
[pipenv.exceptions.InstallError]:   Moving to /Users/samuelebonini/.local/share/virtualenvs/backend-tRSrcCVT/lib/python3.8/site-packages/psycopg2-2.9.3.dist-info/
[pipenv.exceptions.InstallError]:    from /Users/samuelebonini/.local/share/virtualenvs/backend-tRSrcCVT/lib/python3.8/site-packages/~sycopg2-2.9.3.dist-info
[pipenv.exceptions.InstallError]:   Moving to /Users/samuelebonini/.local/share/virtualenvs/backend-tRSrcCVT/lib/python3.8/site-packages/psycopg2/__init__.py
[pipenv.exceptions.InstallError]:    from /private/var/folders/3_/gmcg3yrd7d3d7q4vfw0jyqkm0000gn/T/pip-uninstall-sco0zxmv/__init__.py
[pipenv.exceptions.InstallError]:   Moving to /Users/samuelebonini/.local/share/virtualenvs/backend-tRSrcCVT/lib/python3.8/site-packages/psycopg2/_ipaddress.py
[pipenv.exceptions.InstallError]:    from /private/var/folders/3_/gmcg3yrd7d3d7q4vfw0jyqkm0000gn/T/pip-uninstall-sco0zxmv/_ipaddress.py
[pipenv.exceptions.InstallError]:   Moving to /Users/samuelebonini/.local/share/virtualenvs/backend-tRSrcCVT/lib/python3.8/site-packages/psycopg2/_json.py
[pipenv.exceptions.InstallError]:    from /private/var/folders/3_/gmcg3yrd7d3d7q4vfw0jyqkm0000gn/T/pip-uninstall-sco0zxmv/_json.py
[pipenv.exceptions.InstallError]:   Moving to /Users/samuelebonini/.local/share/virtualenvs/backend-tRSrcCVT/lib/python3.8/site-packages/psycopg2/_psycopg.cpython-38-darwin.so
[pipenv.exceptions.InstallError]:    from /private/var/folders/3_/gmcg3yrd7d3d7q4vfw0jyqkm0000gn/T/pip-uninstall-sco0zxmv/_psycopg.cpython-38-darwin.so
[pipenv.exceptions.InstallError]:   Moving to /Users/samuelebonini/.local/share/virtualenvs/backend-tRSrcCVT/lib/python3.8/site-packages/psycopg2/_range.py
[pipenv.exceptions.InstallError]:    from /private/var/folders/3_/gmcg3yrd7d3d7q4vfw0jyqkm0000gn/T/pip-uninstall-sco0zxmv/_range.py
[pipenv.exceptions.InstallError]:   Moving to /Users/samuelebonini/.local/share/virtualenvs/backend-tRSrcCVT/lib/python3.8/site-packages/psycopg2/errorcodes.py
[pipenv.exceptions.InstallError]:    from /private/var/folders/3_/gmcg3yrd7d3d7q4vfw0jyqkm0000gn/T/pip-uninstall-sco0zxmv/errorcodes.py
[pipenv.exceptions.InstallError]:   Moving to /Users/samuelebonini/.local/share/virtualenvs/backend-tRSrcCVT/lib/python3.8/site-packages/psycopg2/errors.py
[pipenv.exceptions.InstallError]:    from /private/var/folders/3_/gmcg3yrd7d3d7q4vfw0jyqkm0000gn/T/pip-uninstall-sco0zxmv/errors.py
[pipenv.exceptions.InstallError]:   Moving to /Users/samuelebonini/.local/share/virtualenvs/backend-tRSrcCVT/lib/python3.8/site-packages/psycopg2/extensions.py
[pipenv.exceptions.InstallError]:    from /private/var/folders/3_/gmcg3yrd7d3d7q4vfw0jyqkm0000gn/T/pip-uninstall-sco0zxmv/extensions.py
[pipenv.exceptions.InstallError]:   Moving to /Users/samuelebonini/.local/share/virtualenvs/backend-tRSrcCVT/lib/python3.8/site-packages/psycopg2/extras.py
[pipenv.exceptions.InstallError]:    from /private/var/folders/3_/gmcg3yrd7d3d7q4vfw0jyqkm0000gn/T/pip-uninstall-sco0zxmv/extras.py
[pipenv.exceptions.InstallError]:   Moving to /Users/samuelebonini/.local/share/virtualenvs/backend-tRSrcCVT/lib/python3.8/site-packages/psycopg2/pool.py
[pipenv.exceptions.InstallError]:    from /private/var/folders/3_/gmcg3yrd7d3d7q4vfw0jyqkm0000gn/T/pip-uninstall-sco0zxmv/pool.py
[pipenv.exceptions.InstallError]:   Moving to /Users/samuelebonini/.local/share/virtualenvs/backend-tRSrcCVT/lib/python3.8/site-packages/psycopg2/sql.py
[pipenv.exceptions.InstallError]:    from /private/var/folders/3_/gmcg3yrd7d3d7q4vfw0jyqkm0000gn/T/pip-uninstall-sco0zxmv/sql.py
[pipenv.exceptions.InstallError]:   Moving to /Users/samuelebonini/.local/share/virtualenvs/backend-tRSrcCVT/lib/python3.8/site-packages/psycopg2/tz.py
[pipenv.exceptions.InstallError]:    from /private/var/folders/3_/gmcg3yrd7d3d7q4vfw0jyqkm0000gn/T/pip-uninstall-sco0zxmv/tz.py
[pipenv.exceptions.InstallError]: error: subprocess-exited-with-error
[pipenv.exceptions.InstallError]:   
[pipenv.exceptions.InstallError]:   × python setup.py bdist_wheel did not run successfully.
[pipenv.exceptions.InstallError]:   │ exit code: 1
[pipenv.exceptions.InstallError]:   ╰─> [55 lines of output]
[pipenv.exceptions.InstallError]:       /Users/samuelebonini/.local/share/virtualenvs/backend-tRSrcCVT/lib/python3.8/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
[pipenv.exceptions.InstallError]:         warnings.warn(msg, warning_class)
[pipenv.exceptions.InstallError]:       running bdist_wheel
[pipenv.exceptions.InstallError]:       running build
[pipenv.exceptions.InstallError]:       running build_py
[pipenv.exceptions.InstallError]:       creating build
[pipenv.exceptions.InstallError]:       creating build/lib.macosx-10.14-arm64-cpython-38
[pipenv.exceptions.InstallError]:       creating build/lib.macosx-10.14-arm64-cpython-38/psycopg2
[pipenv.exceptions.InstallError]:       copying lib/_json.py -> build/lib.macosx-10.14-arm64-cpython-38/psycopg2
[pipenv.exceptions.InstallError]:       copying lib/extras.py -> build/lib.macosx-10.14-arm64-cpython-38/psycopg2
[pipenv.exceptions.InstallError]:       copying lib/errorcodes.py -> build/lib.macosx-10.14-arm64-cpython-38/psycopg2
[pipenv.exceptions.InstallError]:       copying lib/tz.py -> build/lib.macosx-10.14-arm64-cpython-38/psycopg2
[pipenv.exceptions.InstallError]:       copying lib/_range.py -> build/lib.macosx-10.14-arm64-cpython-38/psycopg2
[pipenv.exceptions.InstallError]:       copying lib/_ipaddress.py -> build/lib.macosx-10.14-arm64-cpython-38/psycopg2
[pipenv.exceptions.InstallError]:       copying lib/__init__.py -> build/lib.macosx-10.14-arm64-cpython-38/psycopg2
[pipenv.exceptions.InstallError]:       copying lib/extensions.py -> build/lib.macosx-10.14-arm64-cpython-38/psycopg2
[pipenv.exceptions.InstallError]:       copying lib/errors.py -> build/lib.macosx-10.14-arm64-cpython-38/psycopg2
[pipenv.exceptions.InstallError]:       copying lib/sql.py -> build/lib.macosx-10.14-arm64-cpython-38/psycopg2
[pipenv.exceptions.InstallError]:       copying lib/pool.py -> build/lib.macosx-10.14-arm64-cpython-38/psycopg2
[pipenv.exceptions.InstallError]:       warning: build_py: byte-compiling is disabled, skipping.
[pipenv.exceptions.InstallError]:       
[pipenv.exceptions.InstallError]:       running build_ext
[pipenv.exceptions.InstallError]:       building 'psycopg2._psycopg' extension
[pipenv.exceptions.InstallError]:       creating build/temp.macosx-10.14-arm64-cpython-38
[pipenv.exceptions.InstallError]:       creating build/temp.macosx-10.14-arm64-cpython-38/psycopg
[pipenv.exceptions.InstallError]:       clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration "-DPSYCOPG_VERSION=2.9.4 (dt dec pq3 ext lo64)" -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=140005 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/Users/samuelebonini/.local/share/virtualenvs/backend-tRSrcCVT/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -I. -I/opt/homebrew/include/postgresql@14 -I/opt/homebrew/include/postgresql@14/server -I/opt/homebrew/Cellar/icu4c/71.1/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/Cellar/lz4/1.9.4/include -c psycopg/adapter_asis.c -o build/temp.macosx-10.14-arm64-cpython-38/psycopg/adapter_asis.o
[pipenv.exceptions.InstallError]:       In file included from psycopg/adapter_asis.c:28:
[pipenv.exceptions.InstallError]:       ./psycopg/psycopg.h:35:10: error: 'Python.h' file not found with <angled> include; use "quotes" instead
[pipenv.exceptions.InstallError]:       #include <Python.h>
[pipenv.exceptions.InstallError]:                ^~~~~~~~~~
[pipenv.exceptions.InstallError]:                "Python.h"
[pipenv.exceptions.InstallError]:       ./psycopg/psycopg.h:35:10: warning: non-portable path to file '<python.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
[pipenv.exceptions.InstallError]:       #include <Python.h>
[pipenv.exceptions.InstallError]:                ^~~~~~~~~~
[pipenv.exceptions.InstallError]:                <python.h>
[pipenv.exceptions.InstallError]:       In file included from psycopg/adapter_asis.c:28:
[pipenv.exceptions.InstallError]:       In file included from ./psycopg/psycopg.h:35:
[pipenv.exceptions.InstallError]:       psycopg/Python.h:31:2: error: "psycopg requires Python 3.6"
[pipenv.exceptions.InstallError]:       #error "psycopg requires Python 3.6"
[pipenv.exceptions.InstallError]:        ^
[pipenv.exceptions.InstallError]:       psycopg/Python.h:34:10: fatal error: 'structmember.h' file not found
[pipenv.exceptions.InstallError]:       #include <structmember.h>
[pipenv.exceptions.InstallError]:                ^~~~~~~~~~~~~~~~
[pipenv.exceptions.InstallError]:       1 warning and 3 errors generated.
[pipenv.exceptions.InstallError]:       
[pipenv.exceptions.InstallError]:       It appears you are missing some prerequisite to build the package from source.
[pipenv.exceptions.InstallError]:       
[pipenv.exceptions.InstallError]:       You may install a binary package by installing 'psycopg2-binary' from PyPI.
[pipenv.exceptions.InstallError]:       If you want to install psycopg2 from source, please install the packages
[pipenv.exceptions.InstallError]:       required for the build and try again.
[pipenv.exceptions.InstallError]:       
[pipenv.exceptions.InstallError]:       For further information please check the 'doc/src/install.rst' file (also at
[pipenv.exceptions.InstallError]:       <https://www.psycopg.org/docs/install.html>).
[pipenv.exceptions.InstallError]:       
[pipenv.exceptions.InstallError]:       error: command '/usr/bin/clang' failed with exit code 1
[pipenv.exceptions.InstallError]:       [end of output]
[pipenv.exceptions.InstallError]:   
[pipenv.exceptions.InstallError]:   note: This error originates from a subprocess, and is likely not a problem with pip.
[pipenv.exceptions.InstallError]:   ERROR: Failed building wheel for psycopg2
[pipenv.exceptions.InstallError]:   error: subprocess-exited-with-error
[pipenv.exceptions.InstallError]:   
[pipenv.exceptions.InstallError]:   × Running setup.py install for psycopg2 did not run successfully.
[pipenv.exceptions.InstallError]:   │ exit code: 1
[pipenv.exceptions.InstallError]:   ╰─> [57 lines of output]
[pipenv.exceptions.InstallError]:       /Users/samuelebonini/.local/share/virtualenvs/backend-tRSrcCVT/lib/python3.8/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
[pipenv.exceptions.InstallError]:         warnings.warn(msg, warning_class)
[pipenv.exceptions.InstallError]:       running install
[pipenv.exceptions.InstallError]:       /Users/samuelebonini/.local/share/virtualenvs/backend-tRSrcCVT/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
[pipenv.exceptions.InstallError]:         warnings.warn(
[pipenv.exceptions.InstallError]:       running build
[pipenv.exceptions.InstallError]:       running build_py
[pipenv.exceptions.InstallError]:       creating build
[pipenv.exceptions.InstallError]:       creating build/lib.macosx-10.14-arm64-cpython-38
[pipenv.exceptions.InstallError]:       creating build/lib.macosx-10.14-arm64-cpython-38/psycopg2
[pipenv.exceptions.InstallError]:       copying lib/_json.py -> build/lib.macosx-10.14-arm64-cpython-38/psycopg2
[pipenv.exceptions.InstallError]:       copying lib/extras.py -> build/lib.macosx-10.14-arm64-cpython-38/psycopg2
[pipenv.exceptions.InstallError]:       copying lib/errorcodes.py -> build/lib.macosx-10.14-arm64-cpython-38/psycopg2
[pipenv.exceptions.InstallError]:       copying lib/tz.py -> build/lib.macosx-10.14-arm64-cpython-38/psycopg2
[pipenv.exceptions.InstallError]:       copying lib/_range.py -> build/lib.macosx-10.14-arm64-cpython-38/psycopg2
[pipenv.exceptions.InstallError]:       copying lib/_ipaddress.py -> build/lib.macosx-10.14-arm64-cpython-38/psycopg2
[pipenv.exceptions.InstallError]:       copying lib/__init__.py -> build/lib.macosx-10.14-arm64-cpython-38/psycopg2
[pipenv.exceptions.InstallError]:       copying lib/extensions.py -> build/lib.macosx-10.14-arm64-cpython-38/psycopg2
[pipenv.exceptions.InstallError]:       copying lib/errors.py -> build/lib.macosx-10.14-arm64-cpython-38/psycopg2
[pipenv.exceptions.InstallError]:       copying lib/sql.py -> build/lib.macosx-10.14-arm64-cpython-38/psycopg2
[pipenv.exceptions.InstallError]:       copying lib/pool.py -> build/lib.macosx-10.14-arm64-cpython-38/psycopg2
[pipenv.exceptions.InstallError]:       warning: build_py: byte-compiling is disabled, skipping.
[pipenv.exceptions.InstallError]:       
[pipenv.exceptions.InstallError]:       running build_ext
[pipenv.exceptions.InstallError]:       building 'psycopg2._psycopg' extension
[pipenv.exceptions.InstallError]:       creating build/temp.macosx-10.14-arm64-cpython-38
[pipenv.exceptions.InstallError]:       creating build/temp.macosx-10.14-arm64-cpython-38/psycopg
[pipenv.exceptions.InstallError]:       clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration "-DPSYCOPG_VERSION=2.9.4 (dt dec pq3 ext lo64)" -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=140005 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/Users/samuelebonini/.local/share/virtualenvs/backend-tRSrcCVT/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -I. -I/opt/homebrew/include/postgresql@14 -I/opt/homebrew/include/postgresql@14/server -I/opt/homebrew/Cellar/icu4c/71.1/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/Cellar/lz4/1.9.4/include -c psycopg/adapter_asis.c -o build/temp.macosx-10.14-arm64-cpython-38/psycopg/adapter_asis.o
[pipenv.exceptions.InstallError]:       In file included from psycopg/adapter_asis.c:28:
[pipenv.exceptions.InstallError]:       ./psycopg/psycopg.h:35:10: error: 'Python.h' file not found with <angled> include; use "quotes" instead
[pipenv.exceptions.InstallError]:       #include <Python.h>
[pipenv.exceptions.InstallError]:                ^~~~~~~~~~
[pipenv.exceptions.InstallError]:                "Python.h"
[pipenv.exceptions.InstallError]:       ./psycopg/psycopg.h:35:10: warning: non-portable path to file '<python.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
[pipenv.exceptions.InstallError]:       #include <Python.h>
[pipenv.exceptions.InstallError]:                ^~~~~~~~~~
[pipenv.exceptions.InstallError]:                <python.h>
[pipenv.exceptions.InstallError]:       In file included from psycopg/adapter_asis.c:28:
[pipenv.exceptions.InstallError]:       In file included from ./psycopg/psycopg.h:35:
[pipenv.exceptions.InstallError]:       psycopg/Python.h:31:2: error: "psycopg requires Python 3.6"
[pipenv.exceptions.InstallError]:       #error "psycopg requires Python 3.6"
[pipenv.exceptions.InstallError]:        ^
[pipenv.exceptions.InstallError]:       psycopg/Python.h:34:10: fatal error: 'structmember.h' file not found
[pipenv.exceptions.InstallError]:       #include <structmember.h>
[pipenv.exceptions.InstallError]:                ^~~~~~~~~~~~~~~~
[pipenv.exceptions.InstallError]:       1 warning and 3 errors generated.
[pipenv.exceptions.InstallError]:       
[pipenv.exceptions.InstallError]:       It appears you are missing some prerequisite to build the package from source.
[pipenv.exceptions.InstallError]:       
[pipenv.exceptions.InstallError]:       You may install a binary package by installing 'psycopg2-binary' from PyPI.
[pipenv.exceptions.InstallError]:       If you want to install psycopg2 from source, please install the packages
[pipenv.exceptions.InstallError]:       required for the build and try again.
[pipenv.exceptions.InstallError]:       
[pipenv.exceptions.InstallError]:       For further information please check the 'doc/src/install.rst' file (also at
[pipenv.exceptions.InstallError]:       <https://www.psycopg.org/docs/install.html>).
[pipenv.exceptions.InstallError]:       
[pipenv.exceptions.InstallError]:       error: command '/usr/bin/clang' failed with exit code 1
[pipenv.exceptions.InstallError]:       [end of output]
[pipenv.exceptions.InstallError]:   
[pipenv.exceptions.InstallError]:   note: This error originates from a subprocess, and is likely not a problem with pip.
[pipenv.exceptions.InstallError]:   WARNING: No metadata found in /Users/samuelebonini/.local/share/virtualenvs/backend-tRSrcCVT/lib/python3.8/site-packages
[pipenv.exceptions.InstallError]: error: legacy-install-failure
[pipenv.exceptions.InstallError]: 
[pipenv.exceptions.InstallError]: × Encountered error while trying to install package.
[pipenv.exceptions.InstallError]: ╰─> psycopg2
[pipenv.exceptions.InstallError]: 
[pipenv.exceptions.InstallError]: note: This is an issue with the package mentioned above, not pip.
[pipenv.exceptions.InstallError]: hint: See above for output from the failure.
ERROR: Couldn't install package: psycopg2
 Package installation failed...
  ☤  ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/1 — 00:00:01

这看起来像是特定于mac的东西,但我不知道我的环境是如何从正常工作到有这个问题的。即使在此之后,我的Pipfile.lock也得到了正确的更新,使用了新版本的sentry及其依赖项,但我想深入了解这个问题。

是什么导致了这一切,有什么可能的解决方案?

EN

回答 2

Stack Overflow用户

发布于 2022-10-14 09:38:11

尝试安装libpq

代码语言:javascript
复制
brew install libpq
票数 1
EN

Stack Overflow用户

发布于 2022-10-14 09:35:43

似乎您以前有过psycopg2==2.9.3,现在它正在尝试安装psycopg2==2.9.4。将其更改为文件中的psycopg2 = "2.9.3"

通常您只应该手动升级pachages的版本。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74067189

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档