cpython - 在 Ubuntu 16.04 上编译 cpython 代码

标签 cpython ubuntu-16.04

我是按照官方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 并使用 --no 告诉 apt-get 忽略依赖项-deps 选项。

关于cpython - 在 Ubuntu 16.04 上编译 cpython 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38933716/

相关文章:

python - 为什么 id({}) == id({}) 和 id([]) == id([]) 在 CPython 中?

python - SWIG:传递二进制数据失败

hadoop - hadoop集群中Namenode和Datanode之间的通信端口是什么

django - Django 的 send_mail 可以使用 sendmail 吗?

linux - 没有登录的顶级命令的 LIRC irexec 行为

python - 如何生成可重复的随机数序列?

python - python字典的奇怪行为

python - 在 C++ 应用程序中嵌入 python 环境

远程收集事实时 JAVA_HOME 不在 Ansible 环境中

c# - 在 ubuntu 16.04 上安装 "monodevelop"IDE 后找不到 asp.net 模板