1、下载Python软件包 Python-2.7.3.tgz (百度或谷歌就有)
2、传到服务器上,放任意目录,在root下解压: tar -xzf Python-2.7.3.tgz
3、解压后进入Python-2.7.3目录,执行 ./configure 进行配置
4、配置完成执行编译:
1 2 |
|
5、替换以前的python默认版本(若有)(创建新的软连接)
1 2 3 |
ln -s /usr/local/bin/python2.7 ./python |
6、然后就可以打印hello,world了
test111:/usr/bin # python
Python 2.7.3 (default, Aug 28 2018, 19:15:29)
[GCC 4.3.4 [gcc-4_3-branch revision 152973]] on linux2
Type "help", "copyright&