我一直在尝试安装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
任何人都可以解决这个问题吗?
# 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
答案 0 :(得分: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
这对我有用。我希望它也适合你......
如果这对您没有帮助,您可以尝试使用this。如果您指定要安装的数据包版本,它似乎有效,如下所示:
apt-get install libpq-dev=8.4.5-2~bpo50+1
让我知道这是否有效!祝福!