0

我一直在尝试安装 psycopg2 以在 virtualenv 中使用。我设法发现它取决于libpq-dev(因为 pip 给我一个Error: pg_config executable not found.错误)可以使用apt-get install libpq-dev.

但是,我所有的安装尝试libpq-dev都导致了以下错误:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:  
 libpq-dev : Depends: libkrb5-dev but it is not going to be installed
E: Broken packages

谁能解决这个问题?

来源.list

# deb cdrom:[Debian GNU/Linux 6.0.1a _Squeeze_ - Official amd64 NETINST Binary-1 20110320-15:00]/ squeeze main

#deb cdrom:[Debian GNU/Linux 6.0.1a _Squeeze_ - Official amd64 NETINST Binary-1 20110320-15:00]/ squeeze main

deb http://ftp.us.debian.org/debian/ squeeze main
deb-src http://ftp.us.debian.org/debian/ squeeze main

deb http://security.debian.org/ squeeze/updates main
deb-src http://security.debian.org/ squeeze/updates main

# squeeze-updates, previously known as 'volatile'
deb http://ftp.us.debian.org/debian/ squeeze-updates main
deb-src http://ftp.us.debian.org/debian/ squeeze-updates main

# Backports repository
deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free

# RabitMq
deb http://www.rabbitmq.com/debian/ testing main
4

1 回答 1

0

尝试将“contrib non-free”添加到每个来源。我认为这是因为这些软件包未列在您在 sources.list 中的来源中。尝试像这个例子一样改变每一行:

deb http://ftp.us.debian.org/debian/ squeeze main contrib non-free
deb-src http://ftp.us.debian.org/debian/ squeeze main contrib non-free

deb http://security.debian.org/ squeeze/updates main contrib non-free
deb-src http://security.debian.org/ squeeze/updates main contrib non-free

deb http://ftp.us.debian.org/debian/ squeeze-updates main contrib non-free
deb-src http://ftp.us.debian.org/debian/ squeeze-updates main contrib non-free

这对我有用。我希望它也对你有用......

如果这对你没有帮助,你可以试试这个。如果您指定要安装的数据包版本,它似乎可以工作,如下所示:

apt-get install libpq-dev=8.4.5-2~bpo50+1

让我知道这是否有效!最良好的祝愿!

于 2012-05-31T04:56:51.567 回答