gpt4 book ai didi

python - 在 ubuntu 20.04 中安装 libpq-dev 的问题

转载 作者:行者123 更新时间:2023-12-03 13:46:54 24 4
gpt4 key购买 nike

我目前正在尝试安装 libpq-dev 来安装 psycopg2。问题是,当我尝试安装它时,出现错误,提示我没有最新的 libpq5 版本。但是,当我尝试下载较新版本的 libpq5 时,系统说我已经有了最新版本。错误示例。

lhmendes@lhmendes-GA-78LMT-S2P:~$ sudo apt-get install 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: libpq5 (= 12.4-0ubuntu0.20.04.1) but 12.4-1.pgdg20.04+1 is to be installed
E: Unable to correct problems, you have held broken packages.
lhmendes@lhmendes-GA-78LMT-S2P:~$ sudo apt-get install libpq5
Reading package lists... Done
Building dependency tree
Reading state information... Done
libpq5 is already the newest version (12.4-1.pgdg20.04+1).
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

最佳答案

任何较新版本的 libpq5 都可能导致此错误。就我而言,它是 libpq5=13.1-1.pgdg20.04+1。
这与 furus 给出的答案类似,但变化是它是 ubuntu 20.04 中的 libpq5(至少在我的情况下)。
我通过安装解决了这个问题

sudo apt-get install libpq5=12.5-0ubuntu0.20.04.1
然后再次安装 liqpq-dev
sudo apt-get install libpq-dev

关于python - 在 ubuntu 20.04 中安装 libpq-dev 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63785462/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com