前言:

  目前python2.6版本很多库已经不支持,在安装库的时候总会遇到很多装不上的事故,特别烦恼,所以以后不纠结,直接升级python版本后再使用,避免多次采坑;当然,未来趋势还是python3.xxx版本,允许条件下,新环境还是用python3.0版本以上比较稳妥。

1.其中一个错误,运行django项目时报错:缺少sqlite3,下面编译需要先安装sqlite3

django.core.exceptions.ImproperlyConfigured: Error loading either pysqlite2 or sqlite3 modules (tried in that order): No module named '_sqlite3'

2.安装Python依赖包:

yum install libffi-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite sqlite-devel readline-devel tk-devel gcc make python-devel libxslt-devel gpgme-devel -y

3.编译安装python

./configure --prefix=/usr/local/python2.
make
make install

4.安装setuptools

/usr/local/python2./bin/python setup.py install

5.安装pip

/usr/local/python2./bin/python setup.py install

6.配置环境变量【可以选择不配置】

vim /etc/profile

ulimit -n
PATH=/usr/local/python2./bin:$PATH
PATH=/usr/local/python2./lib/python2./site-packages/django/bin:$PATH source /etc/profile

7.检查版本

pip -V

pip 19.1. from /usr/local/python2./lib/python2./site-packages/pip-19.1.-py2..egg/pip (python 2.7)

python

Python 2.7. (default, Aug  , ::)
[GCC 4.4. (Red Hat 4.4.-)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

python版本升级流程,升级2.7跟3.x版本流程一样的更多相关文章

  1. 【python】python版本升级,从2.6.6升级到2.7.13

    centos6.5系统自带了2.6.6版本的python,有时候为了项目上的需要,需要将python版本升级到2.7.13,下面介绍了如何进行升级. 说明:python从2.6升级到2.7会引发很多问 ...

  2. python版本升级及pip部署方法

    Python版本升级 CentOS 6.3自带的Python版本为2.6,首先需要升级到2.7版本.由于旧版本的Python已被深度依赖,所以不能卸载原有的Python,只能全新安装. 1.下载Pyt ...

  3. python 版本升级

    python 版本升级 升级python 查看python的版本 python -V Python 2.6.6 下载新版本 wget https://www.python.org/ftp/python ...

  4. Xshell 连接centOS虚拟机、centOS内置python版本升级

    Xshell 连接虚拟机 前置条件:VMware Workstation 12.5.1.Xshell 5 .  centOS 6.6 1.打开虚拟机,输入用户名和密码: 2.输出命令:ifconfig ...

  5. CentOS 6.X Python 2.6升级到Python 2.7 【转】

    前言:一些第三方框架为了降低复杂性,新的版本已经开始不支持旧版本的python,比如Django这个web框架1.8版本及以上仅仅只支持python2.7及以上版本(记忆中是这个1.8版本),pip安 ...

  6. centos python版本升级到3.x

    Linux(CentOS)下将Python的版本升级为3.6.2的方法 1.检查确认系统的相关信息 查看内核版本[root@zstest1 ~]# cat /etc/redhat-release Ce ...

  7. python基础之打/解包及运算符与控制流程

    python基础之打/解包及运算符与控制流程 python中的解压缩(即序列类型的打包和解包) python提供了两个设计元祖和其他序列类型的处理的便利,也就是自动打包与自动解包功能,比如: data ...

  8. Centos 6.4 python 2.6 升级到 2.7

    Centos 6.4 python 2.6 升级到 2.7 分类: Python Linux2013-09-13 21:35 37278人阅读 评论(2) 收藏 举报 一开始有这个需求,是因为用 Ya ...

  9. CentOS6.5 python 2.6升级到2.7

    在CentOS6.5下,将自带的python2.6.6升级到python2.7.3,解决方法如下: 下载python2.7.3包,并解压缩,输入命令:#wget http://python.org/f ...

随机推荐

  1. Java EE javax.servlet中的ServletContext接口

    ServletContext接口 public interface ServletContext (https://docs.oracle.com/javaee/7/api/javax/servlet ...

  2. 18-Perl 错误处理

    1.Perl 错误处理程序运行过程中,总会碰到各式各样的错误,比如打开一个不存在的文件.程序运行过程中如果出现错误就会停止,我们就需要使用一些检测方法来避免错误,从而防止程序退出.Perl 提供了多中 ...

  3. word、ppt转换为pdf

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...

  4. vue.js对列表进行编辑未保存随时变更

    1.不要建立在同一vm对象下 2.使用深拷贝$.extend(true, vm.model, obj); 3.开新标签页

  5. C#拷贝文件

    public void FileCopy(string source, string target) { using (FileStream fileRead = new FileStream(sou ...

  6. ext grid添加2行topbar

    bbar: paginToolbar(this.getStore()), dockedItems: [{ xtype: 'toolbar', dock: 'top', items: me.create ...

  7. Centos7:Solr4.10安装,配置与使用(tomcat环境)

    配置jdk环境,安装tomcat 解压solr bin:是脚本的启动目录 contrib:第三方包存放的目录 dist:编译打包后存放目录,即构建后的输出产物存放的目录 docs:solr文档的存放目 ...

  8. 原生JS-实现轮播图

    用原生JS实现一个轮播图(效果) HTML <div id="outer"> <ul id="imgList"> <!-- 图片列 ...

  9. 1 .net将xml反序列化

    public static T XmlToObject<T>(string str) where T : class { using (Stream stream = new Memory ...

  10. vue 节流

    <!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...