ubuntu10.04中python安装的版本是2.6,对应mv5的编译版本太高了,要换到python2.5.2版本,编译过程中出现这个错误
If you do not do “make -i install”, install may fail with following error (-i means ignore any errors):
SyntaxError: Non-ASCII character '\xe4' in file build/temp.linux-i686-2.5/libffi/fficonfig.py on line 41, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
下载好python2.5.2源码,解压缩,进入到这个解压后的安装目录中,看到Modules/Setup没?就是它了,vi打开它,找到readline块,把原来是注释的一行解注释掉,这是一行在编译的时候会被调用的。
然后参考下面的资料:
I had some problems on one of the servers where it would not compile readline support in to python. I was able to compile reading support in to python by:
echo "readline readline.c -lreadline -ltermcap" >> Modules/Setup.local
Now let us continue with python installation.
./configure --prefix=/usr/local/python-2.5.1 --enable-readline
make -i install
If you do not do “make -i install”, install may fail with following error (-i means ignore any errors):
Compiling /usr/lib/python2.5/zipfile.py ...
make: *** [libinstall] Error 1
接下来将系统的python指定为2.5.2版本,
: ~$ sudo rm /usr/bin/python
:~$ sudo ln -s /usr/local/Python-2.5.2/bin/python /usr/bin/python
这样终端中输入python -V就是2.5.2版本的了