1.在官网上下载Python的Linux源码包
2.解压源码包,在下载文件夹中解压就可以了,安装的时候系统会自动安装到默认的应用目录
3.在解压后的文件夹中执行 ./configure 命令
最后会提示生成了 MakeFIle文件
4.执行 make 命令,生成可执行文件
5.执行 make install 命令
以上2-5步骤,是安装源码包的一般步骤
cent os7上安装的时候遇到的问题:
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... linux2
checking EXTRAPLATDIR...
checking for --without-gcc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/data/python/Python-2.7.8':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
查了一下,发现有一种可能是没有安装gcc编译器,查看了一下本机
gcc -v
果然没有安装gcc编译器,所以先执行
yum install gcc 安装一下再去执行安装python
1431




被折叠的 条评论
为什么被折叠?



