【问题标题】:Build-dependencies for psycopg2 could not be satisfied无法满足 psycopg2 的构建依赖项
【发布时间】:2014-08-30 17:33:11
【问题描述】:

我正在尝试安装 psycopg2 以便将 django 数据库与 postgresql 连接起来。我试过命令:

sudo apt-get build-dep psycopg2

但它会引发错误

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages have unmet dependencies:
libpq-dev : Depends: libkrb5-dev but it is not going to be installed
         Depends: comerr-dev but it is not going to be installed
python-all-dbg : Depends: python (= 2.7.3-0ubuntu2.2) but 2.7.3-0ubuntu7.1 is to be installed
              Depends: python-all (= 2.7.3-0ubuntu2.2) but it is not going to be installed
              Depends: python-dbg (= 2.7.3-0ubuntu2.2) but it is not going to be installed
python-all-dev : Depends: python (= 2.7.3-0ubuntu2.2) but 2.7.3-0ubuntu7.1 is to be installed
              Depends: python-all (= 2.7.3-0ubuntu2.2) but it is not going to be installed
              Depends: python-dev (= 2.7.3-0ubuntu2.2) but 2.7.3-0ubuntu7.1 is to be installed
python3-all-dbg : Depends: python3 (= 3.2.3-0ubuntu1.2) but 3.2.3-5ubuntu1.2 is to be installed
               Depends: python3-all (= 3.2.3-0ubuntu1.2) but it is not going to be installed
               Depends: python3-dbg (= 3.2.3-0ubuntu1.2) but it is not going to be installed
               Depends: python3.2-dbg but it is not going to be installed
python3-all-dev : Depends: python3 (= 3.2.3-0ubuntu1.2) but 3.2.3-5ubuntu1.2 is to be installed
               Depends: python3-all (= 3.2.3-0ubuntu1.2) but it is not going to be installed
               Depends: python3-dev (= 3.2.3-0ubuntu1.2) but 3.2.3-5ubuntu1.2 is to be installed
E: Build-dependencies for psycopg2 could not be satisfied.

虽然满足以下要求意味着我已经安装了以下

Python 2.7
Python 3.4
PostgreSQL versions 9.1 

【问题讨论】:

    标签: django python-2.7 postgresql-9.1


    【解决方案1】:

    我不确定您为什么使用apt-get build-dep 而不是apt-get install。以下命令应该足以将 Django 与 PostgreSQL 一起使用。

    sudo apt-get install libpq-dev
    

    然后在您的虚拟环境中使用 apt-get 或 pip 安装 psycopg2。

    【讨论】:

    • yum 在 RPM 领域安装 postgresql-libs
    猜你喜欢
    • 2015-12-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-11
    • 2019-09-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多