100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > python3交互模式下 按上翻箭头显示乱码_CentOS 6.3中 Python-2.7.3交互模式下方向

python3交互模式下 按上翻箭头显示乱码_CentOS 6.3中 Python-2.7.3交互模式下方向

时间:2020-02-24 16:32:23

相关推荐

python3交互模式下 按上翻箭头显示乱码_CentOS 6.3中 Python-2.7.3交互模式下方向

CentOS 6.3中,Python-2.7.3交互模式下方向键、退格键等出现乱码

#安装readline-devel

# yum install readline-devl

#重新安装python

1. 准备工作

下载源码包

如果没有安装make工具

~#rpm -qa|grep make

yum -y install gcc automake autoconf libtool make

安装zlib

yum install zlib-devel

安装openssl

yum install openssl*

安装bzip2依赖库

yum install -y bzip2*

2. 编译安装

cp Python-2.7.3.tar.bz2 /usr/src/

tar -jxvf Python-2.7.3.tar.bz2

vi Modules/Setup.dist

找到

#SSL=/usr/local/ssl

#_ssl _ssl.c \

# -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \

# -L$(SSL)/lib -lssl -lcrypto

......

#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz

把注释去掉

编译

./configure --prefix=/usr/local/python2.7

makeallmake install

makecleanmake distclean

建立python2.7 软链

~#mv /usr/bin/python /usr/bin/python.bak~#ln -s /usr/local/python2.7/bin/python2.7 /usr/bin/python2.7

~#ln -s /usr/bin/python2.7 /usr/bin/python

3. 解决yum无法使用的问题

~#yum update

There was a problem importing one of the Python modules

required to run yum. The error leading to this problem was:

No module named yum

Please install a package which provides this module, or

verify that the module is installed correctly.

It's possible that the above module doesn't match the

current version of Python, which is:

2.7.3 (default, Dec 18 , 15:43:35)

[GCC 4.4.7 0313 (Red Hat 4.4.7-4)]

If you cannot solve this problem yourself, please go to

the yum faq at:

/wiki/Faq

因为centos 6.3 下yum默认使用的是python2.6

vi /usr/bin/yum

----------------------------------------------------

#!/usr/bin/python

import sys

try:

import yum

except ImportError:

.......

修改为:

#!/usr/bin/python2.6........

python3交互模式下 按上翻箭头显示乱码_CentOS 6.3中 Python-2.7.3交互模式下方向键 退格键等出现乱码...

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。