CentOS 7 编译安装Python2.6.1

来源:互联网 发布:淘宝招聘兼职 编辑:程序博客网 时间:2024/06/08 00:18

编译安装步骤很简单,如下:

# wget https://www.python.org/ftp/python/2.6.1/Python-2.6.1.tgz# tar zxvf Python-2.6.1.tgz# cd Python-2.6.1# ./configure --prefix=/usr/local --enable-shared# make && make install

编译的过程中遇到以下报错信息:

gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE -DSVNVERSION=\"`LC_ALL=C svnversion .`\"  -o Modules/getbuildinfo.o ./Modules/getbuildinfo.cgcc: error: directory": No such file or directorymake: *** [Modules/getbuildinfo.o] Error 1

这个是configure的一个BUG,修改生成的Makefile文件,找到以下内容:

CC=     gcc -pthreadCXX=        g++ -pthreadMAINCC=     $(CC)LINKCC=     $(PURIFY) $(MAINCC)AR=     arRANLIB=     ranlibSVNVERSION= svnversion $(srcdir)

将最后一行的SVNVERSION变量值改为空,然后重新make && make install即可
SVNVERSION=""

0 0
原创粉丝点击