2016-08-13 122 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選項。