备忘 - centos5.6 安装 python 2.7
来源:互联网 发布:数控车床圆弧编程 编辑:程序博客网 时间:2024/06/06 09:57
centos 5.6 自带的python版本为2.4,太旧了。
1. install python 2.7
refer: http://www.cnblogs.com/minglog/archive/2011/04/20/2022479.html
wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2
./configure
make
make install
rm /usr/bin/python
ln -s /usr/local/bin/python2.7 /usr/bin/python
*******************
发现yum不能用了,yum依赖python2.4, 处理如下:
vim /usr/bin/yum
将文件头部的
#!/usr/bin/python
改成
#!/usr/bin/python2.4
就可以继续使用yum了
*******************
2. install setuptools
wget http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg#md5=fe1f997bc722265116870bc7919059ea
sh setuptools-0.6c11-py2.7.egg
3. install python modules
.feedparser
#easy_install feedparser 编码处理有些问题
下载feedparser-5.0.1源码
feedparser.py 3524行
elif http_content_type.startswith('text/'):
#true_encoding = http_encoding or 'us-ascii'
true_encoding = http_encoding or xml_encoding or 'utf-8'
python setup.py build
python setup.py install
.BeautifulSoup
easy_install BeautifulSoup
.chardet
easy_install chardet
.PIL
yum install libjpeg-devel zlib-devel freetype-devel
#easy_install PIL #has problems, not support jpeg, etc
wget http://effbot.org/downloads/Imaging-1.1.7.tar.gz
python setup.py build_ext -i
python setup.py install
.MySQLdb
yum install mysql-devel
http://ncu.dl.sourceforge.net/project/mysql-python/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz
python setup.py build
python setup.py install
4. Tips
easy_install安装后如何删除
编辑 /usr/local/lib/python2.7/site-packages/easy-install.pth , 删除相应的行。删除相应的egg文件。
python -u
-u : unbuffered binary stdout and stderr; also PYTHONUNBUFFERED=x
see man page for details on internal buffering relating to '-u'
- 备忘 - centos5.6 安装 python 2.7
- centos5.6 安装 python 2.7
- CentOS5.6 安装JDK
- Centos5.6安装MUNIN
- CentOS5.6 安装RabbitMQ
- CentOS5.6 安装RabbitMQ
- centos5.6安装xen
- centos5.6搭建python环境
- centos5上安装 svn1.6
- 定制CENTOS5.6安装光盘
- CentOS5.6下安装GitLab
- centos5.6安装部署cobbler
- CentOS5.6安装openoffice4.1
- Centos5 python2.6/2.7 easyinstall安装fabric模块
- centos5 安装
- CentOS5下Python-2.5安装——笔记
- centos5.8安装postgresql以及python模块psycopg2
- Centos5.5 下安装python-pip的坑
- 用VC进行COM编程的初级教程(转)
- php - zoj 1295
- Struts1中action线程安全问题
- NHibernate进行 Text字段映射
- valgrind检查内存泄露命令
- 备忘 - centos5.6 安装 python 2.7
- Linux的王者时代即将到来
- google就是牛
- IDE(集成开发环境)
- .NET简谈反射(动态调用)
- 乒乓操作引起的数据的错误
- 用eclipse生成javadoc文档
- C++类型转换符
- 【看故事】生动解释ARP欺骗、网关等一堆难懂的专业术语