linux下python的安装

下载:http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tar.bz2

安装:

       $ tar –jxvf Python-2.7.5.tar.bz2
       $ cd Python-2.7.5

       $ ./configure
       $ make
       $ make install

配置:

  ln -s Python-2.7.5 python

   vi /etc/profile

 

PYTHON_HOME=/usr/local/python

PATH=$PYTHON_HOME:$PATH  
export JAVA_HOME JAVA_BIN PYTHON_HOME PATH CLASSPATH 

 

 

 

测试:

[root@localhost Python-2.7.5]# python
Python 2.7.5 (default, Sep 22 2013, 18:08:48) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 

 退出:ctrl+z

猜你喜欢

转载自hanqunfeng.iteye.com/blog/1945197
今日推荐