我按照官方cpython代码link here上的说明进行操作。我做了一个

hg update 3.5

然后执行以下操作。
sudo apt-get build-dep python3.5

但是它抛出了一个错误,指出了下面列出的语句:
Reading package lists... Done
Picking 'python3-defaults' as source package instead of 'python3'
E: Unable to find a source package for python3

我确实读过有关减少版本并尝试上述代码集的信息,这也由于以下原因而产生。
$ hg update 2.7
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ sudo apt-get build-dep python2.7
Reading package lists... Done
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:
builddeps:python2.7 : Depends: libdb5.1-dev but it is not installable
E: Unable to correct problems, you have held broken packages

为了解决上述错误,我做了以下操作,该操作也引发了一个错误。
$ sudo apt-get install libdb5.1-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libdb5.1-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source

E: Package 'libdb5.1-dev' has no installation candidate

要解决该错误,我尝试执行以下操作。
$ sudo apt-get install libdb5.1++-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libdb5.1++-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source

E: Package 'libdb5.1++-dev' has no installation candidate

最后,我做到了。
sudo apt-get install libdb++-dev

它已经安装了,但是build-dep没有指向它,仍然引发错误。

我不确定出了什么问题?有人可以帮忙吗?

提前致谢!

最佳答案

您没有说您拥有的libdb版本。 Libdb++仅适用于将使用C++接口(interface)的程序,我认为您不需要。我看到libdb版本5.3.21和libdb4版本4.8.30。如果您已经拥有版本5.3.21,则动态库应为用户/usr/lib64,如libdb-5.3.so,并具有指向该库libdb-5.so的链接。 (我在CentOS上工作,因此对于Ubuntu可能会略有不同。)您可以创建另一个从libdb-5.1.so到您拥有的库的链接,重新安装python3.5并告诉apt-get使用--no忽略依赖项。 -deps选项。

10-06 11:00