python - 无法从源代码安装 python

标签 python python-2.7

每次我尝试从源代码安装 python 2.7.12 时,我都会在运行命令 sudo make install 时遇到错误,并且 python 安装失败。但是在运行 make 时没有错误。可能的错误是什么?

Compiling /usr/local/lib/python2.7/xml/parsers/__init__.py ...
Compiling /usr/local/lib/python2.7/xml/parsers/expat.py ...
Listing /usr/local/lib/python2.7/xml/sax ...
Compiling /usr/local/lib/python2.7/xml/sax/__init__.py ...
Compiling /usr/local/lib/python2.7/xml/sax/_exceptions.py ...
Compiling /usr/local/lib/python2.7/xml/sax/expatreader.py ...
Compiling /usr/local/lib/python2.7/xml/sax/handler.py ...
Compiling /usr/local/lib/python2.7/xml/sax/saxutils.py ...
Compiling /usr/local/lib/python2.7/xml/sax/xmlreader.py ...
Compiling /usr/local/lib/python2.7/xmllib.py ...
Compiling /usr/local/lib/python2.7/xmlrpclib.py ...
Compiling /usr/local/lib/python2.7/zipfile.py ...
make: *** [libinstall] Error 1

最佳答案

很难判断,因为错误太模糊了。我会尝试使用有关您系统的可能选项再次运行配置文件。没有更多信息,我只能猜测您的 Makefile 配置不正确。

您也可以尝试使用带有 deadsnake 存储库的 apt-get 下载它。只需尝试:

add-apt-repository ppa:fkrull/deadsnakes-python2.7
apt-get update
apt-get install python2.7

This link表明它应该给你 python 2.7.12

关于python - 无法从源代码安装 python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38467966/

相关文章:

python - 如何在线程上发送消息?

python - 如何在某些条件下删除 pandas 中的行

python - tensorflow 错误 : 'FileWriter' method

python - 将列表中的字符串填充为相同长度

python - 如何在应用程序启动时将焦点设置在小部件上?

Python XML 解析示例

python - 如何在 python 中定义类?

python - Pandas,将函数应用于返回一对多行的数据框

google-app-engine - 为什么这些延迟任务没有按照添加的顺序执行?

python - pathos.ProcessingPool 和 pickle 之间的交互