我下载了一个github存储库并运行python setup.py文件,在这个文件中我从linux终端运行了$python setup.py命令,但是我得到了以下错误
[setup.py] Running [sudo apt-get -y install libjsoncpp-dev postgresql jq python-psycopg2 python-sqlalchemy socat libpq-dev cmake docker.io bc python-pexpect python-psutil python-lockfile genisoimage inotify-tools build-essential python-pip libprotobuf-c0-dev libodb-pgsql-2.4 libfdt-dev] . . .
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python-psycopg2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package python-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
python3-pip
E: Package 'python-psycopg2' has no installation candidate
E: Package 'python-pip' has no installation candidate
E: Unable to locate package libprotobuf-c0-dev
[setup.py] [sudo apt-get -y install libjsoncpp-dev postgresql jq python-psycopg2 python-sqlalchemy socat libpq-dev cmake docker.io bc python-pexpect python-psutil python-lockfile genisoimage inotify-tools build-essential python-pip libprotobuf-c0-dev libodb-pgsql-2.4 libfdt-dev] cmd did not execute properly.为了逐一修复错误,首先我尝试使用pip install psycopg2安装python-Peckcopg2,输出是:
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: psycopg2 in 'path'我还尝试运行python -m pip install psycopg2,但是输出没有改变。所以我下载了源代码(从https://pypi.org/project/psycopg2/#files),并使用我得到的setup.py:
File "setup.py", line 117
f"Unable to find 'pg_config' file in '{self.pg_config_exe}'")
^
SyntaxError: invalid syntax我如何修复所有的错误?这是python 2.7的问题吗?
发布于 2021-06-22 05:23:11
python 2不支持依赖项,因此不可能使用注释中描述的模块。
https://stackoverflow.com/questions/68069763
复制相似问题