linux下编译安装python2.7.6
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux下编译安装python2.7.6相关的知识,希望对你有一定的参考价值。
安装依赖开发包
yum install readline-devel
yum install *argparse*
wget https://www.python.org/ftp/python/2.7.6/Python2.7.6.tgz
ipython 下载地址https://github.com/ipython/ipython/releases/download/rel-2.1.0/ipython-2.1.0.tar.gz
编译安装python 2.7.6
[[email protected] ~]# tar -xf python-2.7.6.tgz
[[email protected] Python-2.7.6]# ./configure --prefix=/usr/local/python2.7
[[email protected] Python-2.7.6]# make && make install
安装 ipython 补全插件
[[email protected] ~]# tar -xf ipython-5.2.2.tar.gz
[[email protected] ~]# cd ipython-5.2.2
[[email protected] ipython-5.2.2]# /usr/local/python2.7/bin/python2.7 setup.py install
创建软连接
[[email protected] ~]# ln -sv /usr/local/python27/bin/python2.7 /usr/bin/python27
[[email protected] ~]# ln -sv /usr/local/python27/bin/ipython /usr/bin/
报错 1,
[[email protected] bin]# /usr/local/python2.7/bin/ipython
Traceback (most recent call last):
File "/usr/local/python2.7/bin/ipython", line 4, in <module>
from IPython import start_ipython
File "/usr/local/python2.7/lib/python2.7/site-packages/IPython/__init__.py", line 48, in <module>
from .core.application import Application
File "/usr/local/python2.7/lib/python2.7/site-packages/IPython/core/application.py", line 23, in <module>
from traitlets.config.application import Application, catch_config_error
ImportError: No module named traitlets.config.application
先 yum install *argparse* 再重新编译安装 python
本文出自 “明飞成长驿站” 博客,请务必保留此出处http://anyue007.blog.51cto.com/3113658/1901002
以上是关于linux下编译安装python2.7.6的主要内容,如果未能解决你的问题,请参考以下文章