CentOS python2.6.6 升级 2.7.5 并安装pip, apscheduler
来源:互联网 发布:mac 右键 编辑:程序博客网 时间:2024/06/04 18:02
1.查看当前python版本
# python -V
Python 2.6.6 (r266:84292, Jul 23 2015, 15:22:56)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
2.下载python2.7.5
# wget http://python.org/ftp/python/2.7.5/Python-2.7.5.tar.bz2
3.解压
#tar -jxvf Python-2.7.5.tar.bz2
4.配置SSL
# sudo yum install openssl-devel // 如果没有https,需要安装
#cd Python-2.7.5/Modules
# vi Setup.dist
找到:
# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
#SSL=/usr/local/ssl
#_ssl _ssl.c \
# -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
# -L$(SSL)/lib -lssl -lcrypto
改为:
# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
SSL=/usr/local/ssl
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
5.安装python2.7.5
#cd ..
#./configure
#make all
#make install
#make clean
#make distclean
6.建立软连接,使系统默认的 python指向 python2.7
#mv /usr/bin/python /usr/bin/python2.6.6
#ln -s /usr/local/bin/python2.7 /usr/bin/python
7.解决系统 Python 软链接指向 Python2.7 版本后,因为yum是不兼容 Python 2.7的,所以yum不能正常工作,我们需要指定 yum 的Python版本
#vi /usr/bin/yum
将文件头部的
#!/usr/bin/python
改成
#!/usr/bin/python2.6.6
8.安装easy_install
#wget -q http://peak.telecommunity.com/dist/ez_setup.py
#python ez_setup.py
9.安装python包管理安装工具pip
#wget --no-check-certificate https://github.com/pypa/pip/archive/1.5.5.tar.gz
#tar zvxf 1.5.5.tar.gz #解压文件
#cd pip-1.5.5/
#python setup.py install
10. 安装APSchedule
#easy_install apscheduler
报错:
ImportError: <module 'setuptools.dist' from '/usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/dist.pyc'> has no 'check_specifier' attribute
百度不行,google, 终于找到了解决方案
$ sudo pip install setuptools --upgrade
然后再次执行 #easy_install apscheduler 成功
- CentOS python2.6.6 升级 2.7.5 并安装pip, apscheduler
- centos python2.6升级2.7并安装easy_install+pip
- CentOS升级Python2.6到Python2.7并安装pip
- CentOS升级Python2.6到Python2.7并安装pip
- CentOS升级Python2.6到Python2.7并安装pip
- CentOS升级Python2.6到Python2.7并安装pip
- CentOS升级Python2.6到Python2.7并安装pip
- CentOS升级Python2.6到Python2.7并安装pip
- CentOS升级Python2.6到Python2.7并安装pip
- centos 6升级Python2.7安装pip
- CentOS升级Python2.6到Python2.7并安装pip 96 作者 Ruter 关注 2015.12.20 22:14* 字数 588 阅读 8227评论 1喜欢 5 貌似CentOS
- CentOS6.5升级Python2.6到Python2.7并安装pip
- centos6.5升级python2.6到2.7 + 安装pip
- Centos升级Python 2.7.12并安装最新pip
- Centos升级Python 2.7并安装pip、ipython
- Centos升级Python 2.7并安装pip、ipython
- Centos6.8 python2.6升级至2.7,并安装setuptools和pip
- Centos6.8 python2.6升级至2.7,并安装setuptools和pip
- Android手机读取相册图片,根据URI获取图片路径
- ThinkPHP volist 二级循环输出
- Java中的24种设计模式与7大原则
- springmvc文件下载
- Activity显示启动方式和隐式启动方式
- CentOS python2.6.6 升级 2.7.5 并安装pip, apscheduler
- Strategy Design Pattern 策略设计模式
- react native 环境搭建
- C和C指针--第6章习题
- 【Struts2】Struts2学习(7) 拦截器
- 同时执行多个$.getJSON() 数据混乱的问题的解决
- PowerDesigner中怎样切换PDM的数据库管理系统DBMS?
- 字符串aabbbccaaaaa转换成a2b3c2a5,并按照降序输出如a5b3a2c2
- Java基础算法、编写规范等