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

标签 python linux amazon-ec2 pip centos

我正在使用的内容:

  • CentOS Linux 7 (Core)
  • 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。

    最佳答案

    我用:

    pip install psycopg2-binary
    

    关于python - 无法在 EC2(CentOS)上安装 psycopg 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71334162/

    相关文章:

    java - S3DistCp 作业失败 : -- dest doesn't match

    python - Django password_reset 是否支持 html 电子邮件模板?

    python - 在 python 中创建日期为 YYYYMMDD 的文件夹

    c - 在 GNU/Linux 上链接插件时如何巧妙地检测 undefined symbol ?

    linux - 在 bash 脚本中组合 perl 命令

    amazon-web-services - 创建 LaunchConfiguration 并更新 ASG

    python - 覆盖方法不包含 self ?

    python - tkinter Text() 小部件上的 4096 单行字符限制?

    linux - 如何在 Linux 上使用 mail 命令附加文件?

    ubuntu - 在 Amazon EC2 实例上运行 Rails 3.2 的 Gmail 的 ActionMailer 设置