2016-08-13 142 views
9

我对官方cpython代码link here的说明如下。我做了一个在Ubuntu上编译cpython代码16.04

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 

我读过关于降低版本,并试图在上面这组代码,这也conked原因如下。

$ 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没有指向它,仍然抛出错误。

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

在此先感谢!

回答

4

你没有说你有什么版本的libdb。 Libdb ++仅适用于使用C++接口的程序,我认为您不需要这些接口。我看到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选项。