前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >centos5.6 安装 python

centos5.6 安装 python

作者头像
py3study
发布2020-01-10 01:19:01
5510
发布2020-01-10 01:19:01
举报
文章被收录于专栏:python3python3

转自:http://blog.csdn.net/dqatsh/article/details/6592989

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'

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019-09-05 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
云数据库 SQL Server
腾讯云数据库 SQL Server (TencentDB for SQL Server)是业界最常用的商用数据库之一,对基于 Windows 架构的应用程序具有完美的支持。TencentDB for SQL Server 拥有微软正版授权,可持续为用户提供最新的功能,避免未授权使用软件的风险。具有即开即用、稳定可靠、安全运行、弹性扩缩等特点。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档