您可以通过从 PyPI [WINDOWS] 安装'psycopg2-binary'来安装二进制包



嗨,伙计们,我得到这个错误,我不知道如何修复这个

我在控制台中运行的命令如下:

pip install -r ..requirementslocal.txt

It appears you are missing some prerequisite to build the package from source.
You may install a binary package by installing 'psycopg2-binary' from PyPI.
If you want to install psycopg2 from source, please install the packages
required for the build and try again.
For further information please check the 'doc/src/install.rst' file (also at
<http://initd.org/psycopg/docs/install.html>).
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe' failed with exit code 2

我不知道如何解决这个问题,我真的需要帮助

就像它说的那样,尝试安装psycopg2-binary而不是psycopg2——psycopg2将像所有pip包一样从源代码安装,并且需要提供构建工具。我从未在Windows上使用过pip/python,但psycopg2因构建错误而臭名昭著,所以我自己最近求助于二进制文件-除了psycopg2,其他所有东西都是从我的Mac和Linux机器上的源代码构建的。看起来您需要相应地修改需求文件。

最新更新