Linux下Python环境搭建
来源:互联网 发布:网络教育平台有哪些 编辑:程序博客网 时间:2024/05/16 18:40
系统环境
OS:Oracle Linux Enterprise 5.6
1.下载
Python
地址: http://www.python.org/getit/
版本: Python-2.7.3.tgz
setuptools
地址:http://pypi.python.org/pypi/setuptools#downloads
版本:setuptools-0.6c11.tar.gz(md5)
也可以采用wget方式下载:
wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz#md5=7df2a529a074f613b509fb44feefe74e
2.安装Python
--查看系统自带的python:
[root@njdyw ~]# python
python python2 python2.4
--安装Python2.7.3
[root@njdyw ~]# mkdir /python
[root@njdyw ~]# cp Python-2.7.3.tgz /python/
[root@njdyw ~]# cd /python/
[root@njdyw python]# ls
Python-2.7.3.tgz
--解压
[root@njdyw python]# tar -zvxf Python-2.7.3.tgz
[root@njdyw python]# ls
Python-2.7.3 Python-2.7.3.tgz
--configure:避免对原有的Python产生影响,必须制定prefix。
[root@njdyw python]# cd Python-2.7.3
[root@njdyw Python-2.7.3]# ./configure --prefix=/usr/local/python2.7.3
--make:
[root@njdyw Python-2.7.3]# make
--make install:
[root@njdyw Python-2.7.3]# make install
安装成功后目录为:
[root@njdyw Python-2.7.3]# ll /usr/local/python2.7.3/
总计 16
drwxr-xr-x 2 root root 4096 03-21 10:12 bin
drwxr-xr-x 3 root root 4096 03-21 10:07 include
drwxr-xr-x 4 root root 4096 03-21 10:07 lib
drwxr-xr-x 3 root root 4096 03-21 10:07 share
--建立软链接:
[root@njdyw Python-2.7.3]# ln -s /usr/local/python2.7.3/bin/python /bin/python2.7.3
[root@njdyw Python-2.7.3]# python
python python2 python2.4 python2.7.3
[root@njdyw Python-2.7.3]# python2.7.3
Python 2.7.3 (default, Mar 21 2013, 10:06:48)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print 1
1
>>>
3.安装setuptools
--使用wget下载:
[root@njdyw python]# pwd
/python
[root@njdyw python]#wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz#md5=7df2a529a074f613b509fb44feefe74e
[root@njdyw python]# ls
Python-2.7.3 Python-2.7.3.tgz setuptools-0.6c11.tar.gz
--解压:
[root@njdyw python]# tar xzvf setuptools-0.6c11.tar.gz
[root@njdyw python]# ls
Python-2.7.3 Python-2.7.3.tgz setuptools-0.6c11 setuptools-0.6c11.tar.gz
--安装:
[root@njdyw setuptools-0.6c11]# python2.7.3 setup.py install
--建立软链接:
[root@njdyw setuptools-0.6c11]#ln -s /usr/local/python2.7.3/bin/easy_install /bin/easy_install2.7.3
4.测试使用easy_install
[root@njdyw setuptools-0.6c11]# easy_install2.7.3 numpy
参考:
http://f.dataguru.cn/forum.php?mod=viewthread&tid=36405&fromuid=4771
- Linux下Python环境搭建
- Linux下Python环境搭建
- Linux下搭建Python环境
- linux 下 python 环境搭建
- linux下搭建Python环境
- linux下搭建python环境
- Linux下搭建python + nodejs + express环境
- Linux下Python环境的搭建
- linux下搭建python 机器学习环境
- 《Python入门》Linux 下 Python Web开发环境搭建笔记
- Linux搭建python环境
- linux下环境搭建
- Linux下环境搭建
- linux下用eclipse搭建python集成开发环境!
- Python Selenium在Linux环境下的搭建
- linux下pycharm和anaconda搭建python开发环境
- linux下python及numpy编译环境搭建
- pyenv和virtualenv在Linux下搭建python虚拟环境
- Yii2表单提交时报错:Unable to verify your data submission
- 详解PHP SESSION 的TIMEOUT(过期)和总结
- listView主要三种优化方案
- Hibernate的实体类注解详解
- 剑指offer面试题之约瑟夫环问题
- Linux下Python环境搭建
- VisionMobile:2015年Android使用的全球趋势(八)日本引领4G消费
- Calendar类的使用api介绍
- 如何区分广告排名和自然排名?
- 静态代码块与非静态代码块
- Activiti源码分析
- android selector
- 对三维点集的归一化变换
- 搜索首页精选 简介