为psycopg2二进制(setup.py)错误构建轮子,为psycopg2二进制错误运行setup.py安装



我以前安装了python 3.8.3,所以当我运行命令git-push-heroku master 时

它显示了不支持python 3.8.3的错误,所以我安装了最新版本的python 3.10.0,但当我运行命令git-push-heroku master时,它显示python manage.py collectstatic没有输入错误。

所以我运行了pythonmanage.py collectstatic命令,它没有显示名为psycopg2的模块所以我试着安装psycopg2软件包,但它显示了这个错误

我也尝试过卸载python 3.8.3和安装python 3.10.0,但仍然收到错误(图3),我安装的所有软件包都被卸载了,虚拟环境也不工作。

Running setup.py install for psycopg2-binary ... error
ERROR: Command errored out with exit status 1:
command: 'C:UsersdeAppDataLocalProgramsPythonPython310python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\de\AppData\Local\Temp\pip-install-z248sguy\psycopg2-binary_78c223d07cf549a0ac2806ede8a207e1\setup.py'"'"'; __file__='"'"'C:\Users\de\AppData\Local\Temp\pip-install-z248sguy\psycopg2-binary_78c223d07cf549a0ac2806ede8a207e1\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if 
os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersdeAppDataLocalTemppip-record-s3te9bn_install-record.txt' --single-version-externally-managed --compile --install-headers 'C:UsersdeAppDataLocalProgramsPythonPython310Includepsycopg2-binary'
cwd: C:UsersdeAppDataLocalTemppip-install-z248sguypsycopg2-binary_78c223d07cf549a0ac2806ede8a207e1
Complete output (20 lines):
running install
running build
running build_py
creating build
creating buildlib.win-amd64-3.10
creating buildlib.win-amd64-3.10psycopg2
copying liberrorcodes.py -> buildlib.win-amd64-3.10psycopg2
copying liberrors.py -> buildlib.win-amd64-3.10psycopg2
copying libextensions.py -> buildlib.win-amd64-3.10psycopg2
copying libextras.py -> buildlib.win-amd64-3.10psycopg2
copying libpool.py -> buildlib.win-amd64-3.10psycopg2
copying libsql.py -> buildlib.win-amd64-3.10psycopg2
copying libtz.py -> buildlib.win-amd64-3.10psycopg2
copying lib_ipaddress.py -> buildlib.win-amd64-3.10psycopg2
copying lib_json.py -> buildlib.win-amd64-3.10psycopg2
copying lib__init__.py -> buildlib.win-amd64-3.10psycopg2
running build_ext
building 'psycopg2._psycopg' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:UsersdeAppDataLocalProgramsPythonPython310python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\de\AppData\Local\Temp\pip-install-z248sguy\psycopg2-binary_78c223d07cf549a0ac2806ede8a207e1\setup.py'"'"'; __file__='"'"'C:\Users\de\AppData\Local\Temp\pip-install-z248sguy\psycopg2-binary_78c223d07cf549a0ac2806ede8a207e1\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersdeAppDataLocalTemppip-record-s3te9bn_install-record.txt' --single-version-externally-managed --compile --install-headers 'C:UsersdeAppDataLocalProgramsPythonPython310Includepsycopg2-binary' Check the logs for full command output

pip install psycopg对我有效。不要提及版本即("pip-install psycopg2")。

相关内容