在centos系统中创建Django app,报错如下:

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

解决方案:

  1. 安装sqlite-devel-3.3.6-2.x86_64.rpm:

    在centos仓库里有该软件包,通过yum直接安装即可:

    [root@localhost mysite]# yum install sqlite-devel

    已加载插件:fastestmirror, langpacks

    Loading mirror speeds from cached hostfile

    * base: mirrors.aliyun.com

    * extras: mirrors.yun-idc.com

    * updates: mirrors.btte.net

    软件包 sqlite-devel-3.7.17-4.el7.x86_64 已安装并且是最新版本

    无须任何处理

    由于我的已安装过,这里不再安装。

  2.  

    重新安装python3.3:

    [root@localhost Python-3.3.0]# ls

    build          config.sub    Grammar     libpython3.3m.a  Makefile.pre     Objects  pybuilddir.txt  Python         Tools

    config.guess   configure     Include     LICENSE          Makefile.pre.in  Parser   pyconfig.h      python-gdb.py

    config.log     configure.ac  install-sh  Mac              Misc             PC       pyconfig.h.in   README

    config.status  Doc           Lib         Makefile         Modules          PCbuild  python          setup.py

    当前目录为python3.3的安装目录:运行如下命令:

    ./configure --prefix=/usr/local/python

    make

    make install

  3. 3

    经过以上2步,重新导入sqlite3试试:

    [root@localhost mysite]# python3.3

    Python 3.3.0 (default, Oct 10 2014, 11:52:13)

    [GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux

    Type "help", "copyright", "credits" or "license" for more information.

    >>> import sqlite3

    >>>

    没有报错,说明导入正常。

     

centos7 python3.5中引入sqlite3的更多相关文章

  1. centos7 Python3终端中敲击方向键显示「^[[C^[[D」

    [root@localhost src]# python3 Python ( , ::) [GCC (Red Hat -)] on linux Type "help", " ...

  2. python3.5中import sqlite3报错:ImportError: No module named _sqlite3

    原因:缺少相关库 解决方案: 1  安装相关库 yum install sqlite-devel 2  重新编译安装Python

  3. python中引入包的时候报错AttributeError: module 'sys' has no attribute 'setdefaultencoding'解决方法?

    python中引入包的时候报错:import unittestimport smtplibimport timeimport osimport sysimp.reload(sys)sys.setdef ...

  4. centos7 python3.5 下安装paramiko

    centos7 python3.5 下安装paramiko 安装开发包 yum install openssl openssl-devel python-dev -y 安装pip前需要前置安装setu ...

  5. 【译】深入理解python3.4中Asyncio库与Node.js的异步IO机制

    转载自http://xidui.github.io/2015/10/29/%E6%B7%B1%E5%85%A5%E7%90%86%E8%A7%A3python3-4-Asyncio%E5%BA%93% ...

  6. python3.7中asyncio的具体实现

    讲讲我在使用python异步IO语法时踩过的坑 简单介绍异步IO的原理 以及利用最新语法糖实现异步IO的步骤, 然后给出实现异步的不同例子 网上找了很多python的asyncio示例.很多都是用 # ...

  7. centos7+python3.6+nginx+uwsgi+django2的搭建笔记

    公司需上线一套python编写的代码,需要给搭建一套环境  ,本次采用centos7+python3.6+nginx+uwsgi2+django2+mysql5.7的方式来进行搭建 写在部署前 在线上 ...

  8. Java 终于在 Java 8 中引入了 Lambda 表达式。也称之为闭包或者匿名函数。

    本文首发于 blog.zhaochunqi.com 转载请注明 blog.zhaochunqi.com 根据JSR 335, Java 终于在 Java 8 中引入了 Lambda 表达式.也称之为闭 ...

  9. python接口自动化:python3.6中import Crypto.Hash报错的解决方案

    一:问题 python3.6中算法加密引入包Crypto报错,即便安装了: pip install crypto pip install pycrypto pip install pycryptodo ...

随机推荐

  1. springmvc搭建环境时报No mapping found for HTTP request with URI [/exam3/welcome] in DispatcherServlet with name 'spring2'

    项目是使用spring MVC (1)在浏览器中访问,后台总报错: No mapping found for HTTP request with URI [/exam3/welcome] in Dis ...

  2. 切换tab页

    //切换Tab页        $('#tt').tabs({               border:false,               onSelect:function(title){ ...

  3. 【android】环形进度条实现

    先上效果图(压缩尺寸后出现锯齿,原图边缘很细腻的喂~) 特性: 1:支持环形带字 .环形不带字(中间盖上圆形图片,实现天天动听播放器在通知栏播放进度的效果).实心 2:线程安全,不需要写handler ...

  4. mac配置--ant

    每次在新的电脑安装开发工具总是免不了下载各种软件和配置环境,本文针对mac下安装ant小结一下. 安装ant的方法很多,最直接的可以到apache-ant官网http://ant.apache.org ...

  5. 关于Unity中鼠标选取物体的解决方案

    今天修改了之前写的飞机大战的代码,原来的不足之处是点击屏幕的任意一点都可以移动飞机,也就是没有检测鼠标到底有没有点到飞机上. 我先是用之前的3D拾取技术,发现没有反应,才意识到我这个plane飞机节点 ...

  6. Linux 错误记录

    1.libmysqlclient.so.18: cannot open shared object file: No such file or directory 解决办法: [root@linux- ...

  7. Deep Residual Learning for Image Recognition这篇文章

    作者:何凯明等,来自微软亚洲研究院: 这篇文章为CVPR的最佳论文奖:(conference on computer vision and pattern recognition) 在神经网络中,常遇 ...

  8. 第三百三十八节,Python分布式爬虫打造搜索引擎Scrapy精讲—深度优先与广度优先原理

    第三百三十八节,Python分布式爬虫打造搜索引擎Scrapy精讲—深度优先与广度优先原理 网站树形结构 深度优先 是从左到右深度进行爬取的,以深度为准则从左到右的执行(递归方式实现)Scrapy默认 ...

  9. PLSQL Developer连接不上64位Oracle 10g的解决办法

    下载instantclient-basic-win32-10.2.0.4.zip 假设Oracle 10g的安装目录为D:\oracle\product\10.2.0\db1 首先,将instantc ...

  10. Unity3d游戏开发中使用可空类型(Nullable Types)

    你怎么确定一个Vector3,int,或float变量是否被分配了一个值?一个方便的方式就是使用可空类型! 有时变量携带重要信息,但仅仅有在特定的游戏事件发生时触发.比如:一个角色在你的游戏可能闲置, ...