Python编译安装错误
今天心血来潮买了云服务器体验一把,主要是想有个环境可以学习和验证自己对编程、系统和网络的一些理解。
系统版本
CentOS release 6.3 (Final)
configure错误
碰到已下错误,很明显没GCC工具不在环境变量PATH里面,可以看出云服务器默认没有安装
[root@Sven Python-3.3.2]# ./configure --prefix=/usr/local/python33
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for --enable-universalsdk... no
checking for --with-universal-archs... 32-bit
checking MACHDEP... linux
checking for --without-gcc... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/usr/local/src/Python-3.3.2':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
解决方案
yum安装gcc,
yum install gcc -y
make错误
当我准备make 的时候发现这个也没有,囧
[root@Sven Python-3.3.2]# make
-bash: make: command not found
果断安装make搞定
yum install make -y
结果
然后就没有然后了,安装好了,把新安装的执行程序软链到环境变量就可以用了:
ln -s /usr/local/python33/bin/python3 /usr/bin/python3