无法在 EC2 (CentOS) 上 pip 安装 psycopg 3

发布于 2025-01-11 10:42:53 字数 3421 浏览 0 评论 0原文

我正在使用的内容:

  • CentOS Linux 7(核心)
  • Python 3.9.10
  • pip 22.0.3
  • 使用virtualenv > 其中 pip list
Package    Version
---------- -------
pip        22.0.3
setuptools 60.9.3
wheel      0.37.1

我尝试安装的方式 psycopg (也尝试了 sudo 和/或 pip3):

1:

pip install psycopg[binary]
Collecting psycopg[binary]
  Using cached psycopg-3.0.9-py3-none-any.whl (141 kB)
  Using cached psycopg-3.0.8-py3-none-any.whl (142 kB)
  Using cached psycopg-3.0.7-py3-none-any.whl (141 kB)
  Using cached psycopg-3.0.6-py3-none-any.whl (141 kB)
  Using cached psycopg-3.0.5-py3-none-any.whl (141 kB)
  Using cached psycopg-3.0.4-py3-none-any.whl (140 kB)
  Using cached psycopg-3.0.3-py3-none-any.whl (140 kB)
  Using cached psycopg-3.0.2-py3-none-any.whl (140 kB)
  Using cached psycopg-3.0.1-py3-none-any.whl (140 kB)
  Using cached psycopg-3.0-py3-none-any.whl (140 kB)
ERROR: Cannot install psycopg[binary]==3.0, psycopg[binary]==3.0.1, psycopg[binary]==3.0.2, psycopg[binary]==3.0.3, psycopg[binary]==3.0.4, psycopg[binary]==3.0.5, psycopg[binary]==3.0.6, psycopg[binary]==3.0.7, psycopg[binary]==3.0.8 and psycopg[binary]==3.0.9 because these package versions have conflicting dependencies.

The conflict is caused by:
    psycopg[binary] 3.0.9 depends on psycopg-binary==3.0.9; extra == "binary"
    psycopg[binary] 3.0.8 depends on psycopg-binary==3.0.8; extra == "binary"
    psycopg[binary] 3.0.7 depends on psycopg-binary==3.0.7; extra == "binary"
    psycopg[binary] 3.0.6 depends on psycopg-binary==3.0.6; extra == "binary"
    psycopg[binary] 3.0.5 depends on psycopg-binary==3.0.5; extra == "binary"
    psycopg[binary] 3.0.4 depends on psycopg-binary==3.0.4; extra == "binary"
    psycopg[binary] 3.0.3 depends on psycopg-binary==3.0.3; extra == "binary"
    psycopg[binary] 3.0.2 depends on psycopg-binary==3.0.2; extra == "binary"
    psycopg[binary] 3.0.1 depends on psycopg-binary==3.0.1; extra == "binary"
    psycopg[binary] 3.0 depends on psycopg-binary==3.0; extra == "binary"

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

2:

pip install psycopg[binary]==3.0.8
Collecting psycopg[binary]==3.0.8
  Using cached psycopg-3.0.8-py3-none-any.whl (142 kB)
ERROR: Could not find a version that satisfies the requirement psycopg-binary==3.0.8; extra == "binary" (from psycopg[binary]) (from versions: none)
ERROR: No matching distribution found for psycopg-binary==3.0.8; extra == "binary"

3:

pip install psycopg-binary
ERROR: Could not find a version that satisfies the requirement psycopg-binary (from versions: none)
ERROR: No matching distribution found for psycopg-binary

这里没有选项了,任何帮助都是赞赏。它可以在我的本地计算机上运行,​​但不能在 EC2 上运行。

What I'm working with:

  • CentOS Linux 7 (Core)
  • Python 3.9.10
  • pip 22.0.3
  • Using virtualenv where pip list is
Package    Version
---------- -------
pip        22.0.3
setuptools 60.9.3
wheel      0.37.1

How I'm trying to install psycopg (tried sudo and/or pip3 on each too):

1:

pip install psycopg[binary]
Collecting psycopg[binary]
  Using cached psycopg-3.0.9-py3-none-any.whl (141 kB)
  Using cached psycopg-3.0.8-py3-none-any.whl (142 kB)
  Using cached psycopg-3.0.7-py3-none-any.whl (141 kB)
  Using cached psycopg-3.0.6-py3-none-any.whl (141 kB)
  Using cached psycopg-3.0.5-py3-none-any.whl (141 kB)
  Using cached psycopg-3.0.4-py3-none-any.whl (140 kB)
  Using cached psycopg-3.0.3-py3-none-any.whl (140 kB)
  Using cached psycopg-3.0.2-py3-none-any.whl (140 kB)
  Using cached psycopg-3.0.1-py3-none-any.whl (140 kB)
  Using cached psycopg-3.0-py3-none-any.whl (140 kB)
ERROR: Cannot install psycopg[binary]==3.0, psycopg[binary]==3.0.1, psycopg[binary]==3.0.2, psycopg[binary]==3.0.3, psycopg[binary]==3.0.4, psycopg[binary]==3.0.5, psycopg[binary]==3.0.6, psycopg[binary]==3.0.7, psycopg[binary]==3.0.8 and psycopg[binary]==3.0.9 because these package versions have conflicting dependencies.

The conflict is caused by:
    psycopg[binary] 3.0.9 depends on psycopg-binary==3.0.9; extra == "binary"
    psycopg[binary] 3.0.8 depends on psycopg-binary==3.0.8; extra == "binary"
    psycopg[binary] 3.0.7 depends on psycopg-binary==3.0.7; extra == "binary"
    psycopg[binary] 3.0.6 depends on psycopg-binary==3.0.6; extra == "binary"
    psycopg[binary] 3.0.5 depends on psycopg-binary==3.0.5; extra == "binary"
    psycopg[binary] 3.0.4 depends on psycopg-binary==3.0.4; extra == "binary"
    psycopg[binary] 3.0.3 depends on psycopg-binary==3.0.3; extra == "binary"
    psycopg[binary] 3.0.2 depends on psycopg-binary==3.0.2; extra == "binary"
    psycopg[binary] 3.0.1 depends on psycopg-binary==3.0.1; extra == "binary"
    psycopg[binary] 3.0 depends on psycopg-binary==3.0; extra == "binary"

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

2:

pip install psycopg[binary]==3.0.8
Collecting psycopg[binary]==3.0.8
  Using cached psycopg-3.0.8-py3-none-any.whl (142 kB)
ERROR: Could not find a version that satisfies the requirement psycopg-binary==3.0.8; extra == "binary" (from psycopg[binary]) (from versions: none)
ERROR: No matching distribution found for psycopg-binary==3.0.8; extra == "binary"

3:

pip install psycopg-binary
ERROR: Could not find a version that satisfies the requirement psycopg-binary (from versions: none)
ERROR: No matching distribution found for psycopg-binary

Running out of options here, any help would be appreciated. It works on my local machine, but not on EC2.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

把回忆走一遍 2025-01-18 10:42:53

我用:

pip install psycopg2-binary

I use:

pip install psycopg2-binary
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文