首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >运行setup.py后的安装依赖关系问题

运行setup.py后的安装依赖关系问题
EN

Stack Overflow用户
提问于 2021-06-21 22:30:08
回答 1查看 241关注 0票数 0

我下载了一个github存储库并运行python setup.py文件,在这个文件中我从linux终端运行了$python setup.py命令,但是我得到了以下错误

代码语言:javascript
复制
[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,输出是:

代码语言:javascript
复制
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:

代码语言:javascript
复制
    File "setup.py", line 117
        f"Unable to find 'pg_config' file in '{self.pg_config_exe}'")
                                                               ^
SyntaxError: invalid syntax

我如何修复所有的错误?这是python 2.7的问题吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-06-22 05:23:11

python 2不支持依赖项,因此不可能使用注释中描述的模块。

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

https://stackoverflow.com/questions/68069763

复制
相关文章

相似问题

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