运行 setup.py 后安装依赖问题
Install dependencies issue after running setup.py
我下载了一个 github 存储库和 运行 python setup.py 文件运行来自 [=33] 的 $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-psycopg2,输出是:
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 问题吗?
python2 不支持依赖项,因此无法使用评论中描述的模块。
我下载了一个 github 存储库和 运行 python setup.py 文件运行来自 [=33] 的 $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-psycopg2,输出是:
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 问题吗?
python2 不支持依赖项,因此无法使用评论中描述的模块。