加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

linux下python安装及第三方库的安装

(2014-11-29 18:30:55)
标签:

it

###########linux下python安装############################
1.下载源代码 
http://www.python.org/ftp/python/2.5.2/Python-2.5.2.tar.bz2
2.  安装
       $ tar –jxvf Python-2.5.2.tar.bz2
       $ cd Python-2.5.2
       $ ./configure
       $ make
       $ make install
3. 测试
       在命令行下输入python,出现python解释器即表示已经正确安装。
在suse10或rhel5(es5)下系统默认已经装了python但版本是2.4.x;本次安装后在shell中输入
#python
会发现显示结果:
# python
Python 2.4.3 (#1, Dec 11 2006, 11:38:52) 
[GCC 4.1.1 20061130 (Red Hat 4.1.1-43)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
版本还是2.4.x的
解决办法:
        #cd /usr/bin
        #ll |grep python   //查看该目录下python
        #rm -rf python
        #ln -s PREFIX/Python-2.5.2/python ./python  //PREFIX为你解压python的目录
                #python
                
                      # python
                         Python 2.5.2 (#1, Dec 11 2006, 11:38:52) 
                         [GCC 4.1.1 20061130 (Red Hat 4.1.1-43)] on linux2
                        Type "help", "copyright", "credits" or "license" for more information.
                         >>> 

###############查找python安装位置###############

 http://s15/mw690/0027XXvTzy6NZFPH4Vo6e&690
选择  /usr/lib64/python2.6

 

##################安装第三方库#########################

可以先打开setuptools的python官网看看setuptools软件包如何安装:

 

> wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
> python ez_setup.py --user

也可以下载setuptools软件包后安装:

(1)下载setuptools包
# wget http://pypi.python.org/packages/source/s/setuptools/setuptools-2.0.tar.gz
(2)解压setuptools包
# tar zxvf setuptools-2.0.tar.gz

(3)切换到当前文件夹

# cd setuptools-2.0
(4)编译setuptools
# python setup.py build
(5)开始执行setuptools安装
# python setup.py install

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有