python manage.py startapp app

报错如下:

File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.9.13-py2.7.egg/django/core/management/__init__.py", line 353, in execute_from_command_line
    utility.execute()
  File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.9.13-py2.7.egg/django/core/management/__init__.py", line 327, in execute
    django.setup()
  File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.9.13-py2.7.egg/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.9.13-py2.7.egg/django/apps/registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.9.13-py2.7.egg/django/apps/config.py", line 202, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/local/python2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.9.13-py2.7.egg/django/contrib/auth/models.py", line 4, in <module>
    from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
  File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.9.13-py2.7.egg/django/contrib/auth/base_user.py", line 49, in <module>
    class AbstractBaseUser(models.Model):
  File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.9.13-py2.7.egg/django/db/models/base.py", line 108, in __new__
    new_class.add_to_class('_meta', Options(meta, app_label))
  File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.9.13-py2.7.egg/django/db/models/base.py", line 307, in add_to_class
    value.contribute_to_class(cls, name)
  File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.9.13-py2.7.egg/django/db/models/options.py", line 263, in contribute_to_class
    self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
  File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.9.13-py2.7.egg/django/db/__init__.py", line 36, in __getattr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.9.13-py2.7.egg/django/db/utils.py", line 212, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.9.13-py2.7.egg/django/db/utils.py", line 116, in load_backend
    return import_module('%s.base' % backend_name)
  File "/usr/local/python2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.9.13-py2.7.egg/django/db/backends/sqlite3/base.py", line 39, in <module>
    raise ImproperlyConfigured("Error loading either pysqlite2 or sqlite3 modules (tried in that order): %s" % exc)
django.core.exceptions.ImproperlyConfigured: Error loading either pysqlite2 or sqlite3 modules (tried in that order): No module named _sqlite3

解决:

1,首先安装 sqlite-devel

yum install sqlite-devel

2,重新编译安装Python

./configure

make

make install

python manage.py startapp app 时候报错No module named _sqlite3的更多相关文章

  1. Django学习(1)——python manage.py startapp app-name新建app报错问题

    作为一个刚接触python的小白,开始学习Django注定前路漫漫,记录一下学习过程中的问题和解决方案. 感谢“自强学堂”的无私奉献,根据教程安装了Django 1.9.12后,尝试新建项目,此时使用 ...

  2. 关于django python manage.py startapp 应用名 出错异常原因

    如题,在控制台运行python manage.py startapp sales 建立一个应用报错异常 1.应用名不能包含下划线等字符 所以app-demo 不能作为应用名被定义 2.manage.p ...

  3. mac 上python编译报错No module named MySQLdb

    mac 上python编译报错No module named MySQLdb You installed python You did brew install mysql You did expor ...

  4. python踩坑系列之导入包时下划红线及报错“No module named”问题

    python踩坑系列之导入包时下划红线及报错“No module named”问题 使用pycharm编写Python时,自己写了一个包(commontool),在同级另一个路径下(fileshand ...

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

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

  6. scrapy 运行时报错 No module named _sqlite3

    新服务器上运行scrapy时报错 exceptions.ImportError: No module named _sqlite3 原因 由于新的环境缺少sqlite的依赖,编译python3是虽然不 ...

  7. C#调用Python,报错No module named os

    C#调用Python 环境:Windows 8.1,已经安装Python2.7(C:\Python27),配置了环境变量. 已经安装VS2013,VS2017 1.安装IronPython 下载地址h ...

  8. python django2.x报错No module named 'django.core.urlresolvers'

    解决方法就是: from django.urls import reverse 最近从django1.9迁移到django2.0中出现一个意外的报错: 这个报错的原因在stack overflow上有 ...

  9. Python 导入requests报错No module named requests

    刚开始是在Pycharm里面,发现就是不对,导入老提示No module named requests这个错误.后面发现是指向的python.exe路径不对,到setting里面设置换一下路径就好.

随机推荐

  1. linux下的常见信号总结

    在linux下有很多信号,按可靠性分为可靠信号和非可靠信号,按时间分为实时信号和非实时信号,linux进程也有三种方式来处理收到的信号: (1)忽略信号,即对信号不做任何处理,其中,有两个信号不能忽略 ...

  2. spring-data-elasticsearch使用笔记

    使用spring-data遇到了一些问题,记录一下. spring-data-elasticsearch版本选择 这里有一份官方github上的spring-data-elasticsearch与el ...

  3. [转]JQuery控制div外点击隐藏,div内点击不会隐藏

    一直弄清楚这个效果如何实现,看了这篇博客的几行代码原来如此简单,就是利用了事件冒泡而已. 比如有个div其id为body,实现在div外点击隐藏,div内点击不隐藏,采用jQuery实现如下: $(& ...

  4. 用ping命令简单的测试 延时、抖动、丢包率

    在DOS命令状态下输入 :ping 202.105.135.211 -t (连续的对该IP地址执行Ping命令,直到被用户以Ctrl+C中断)就会得到下面的结果:Pinging 202.105.135 ...

  5. [转]win7 如何升级PowerShell

    本文转自:http://www.cnblogs.com/wenBlog/p/6198354.html 背景: 开发的PowerShell 脚本需要使用Invoke-RestMethod命令,发现在老的 ...

  6. continue break return

    ontinue: 可以让程序跳过,continue关键字之后的语句,回到while循环的第一行命令 break: 让程序完全跳出循环,结束while循环的执行 return: 从查询或过程中无条件退出 ...

  7. SpringSecurity 3.2入门(5)自定义登录页面

    增加spring-security.xml文件配置如下 <!-- 配置SpringSecurity的http安全服务 --> <security:http auto-config=& ...

  8. 05.if结构

    分支结构:if  if-else 选择结构:if else-if switch-case 循环结构:while do-while for foreach if语句 语法: if(判断条件) { //要 ...

  9. IDEA安装及破解永久版教程————鹏鹏

    ---恢复内容开始--- 首先我们先来介绍下什么是IDEA? IDEA 全称 IntelliJ IDEA,是java编程语言开发的集成环境.IntelliJ在业界被公认为最好的java开发工具之一,尤 ...

  10. PAT 1036 Boys vs Girls

    #include <cstdio> #include <iostream> #include <cstdlib> #include <algorithm> ...