在linux机器上,运行django执行新建app命令python manage.py startapp learn,报错:
No module named _sqlite3
详细错误如下:
[python] view plain copy #pythonmanage.pystartapplearn Traceback(mostrecentcalllast): file"manage.py",line10,in<module> execute_from_command_line(sys.argv) file"/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py",line353,153);background-color:inherit;Font-weight:bold;">inexecute_from_command_line utility.execute() 327,153);background-color:inherit;Font-weight:bold;">inexecute django.setup() file"/usr/local/lib/python2.7/site-packages/django/__init__.py",line18,153);background-color:inherit;Font-weight:bold;">insetup apps.populate(settings.INSTALLED_APPS) file"/usr/local/lib/python2.7/site-packages/django/apps/registry.py",line108,153);background-color:inherit;Font-weight:bold;">inpopulate app_config.import_models(all_models) file"/usr/local/lib/python2.7/site-packages/django/apps/config.py",line202,153);background-color:inherit;Font-weight:bold;">inimport_models self.models_module=import_module(models_module_name) file"/usr/local/lib/python2.7/importlib/__init__.py",line37,153);background-color:inherit;Font-weight:bold;">inimport_module __import__(name) file"/usr/local/lib/python2.7/site-packages/django/contrib/auth/models.py",line4,248);line-height:18px;List-style-position:outsIDe;">fromdjango.contrib.auth.base_userimportAbstractBaseUser,BaseUserManager file"/usr/local/lib/python2.7/site-packages/django/contrib/auth/base_user.py",line49,153);background-color:inherit;Font-weight:bold;">classAbstractBaseUser(models.Model): file"/usr/local/lib/python2.7/site-packages/django/db/models/base.py",153);background-color:inherit;Font-weight:bold;">in__new__ new_class.add_to_class('_Meta',Options(Meta,app_label)) 299,153);background-color:inherit;Font-weight:bold;">inadd_to_class value.contribute_to_class(cls,name) file"/usr/local/lib/python2.7/site-packages/django/db/models/options.py",line263,153);background-color:inherit;Font-weight:bold;">incontribute_to_class self.db_table=truncate_name(self.db_table,connection.ops.max_name_length()) file"/usr/local/lib/python2.7/site-packages/django/db/__init__.py",line36,153);background-color:inherit;Font-weight:bold;">in__getattr__ returngetattr(connections[DEFAulT_DB_AliAS],item) file"/usr/local/lib/python2.7/site-packages/django/db/utils.py",line212,153);background-color:inherit;Font-weight:bold;">in__getitem__ backend=load_backend(db['ENGINE']) 116,153);background-color:inherit;Font-weight:bold;">inload_backend returnimport_module('%s.base'%backend_name) file"/usr/local/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py",line39,153);background-color:inherit;Font-weight:bold;">raiseImproperlyConfigured("Errorloadingeitherpysqlite2orsqlite3modules(trIEdinthatorder):%s"%exc) django.core.exceptions.ImproperlyConfigured:Errorloadingeitherpysqlite2orsqlite3modules(trIEdinthatorder):Nomodulenamed_sqlite3解决:
1,首先安装 sqlite-devel
yum install sqlite-devel
2,重新编译安装Python
./configure
make
make install 总结以上是内存溢出为你收集整理的解决No module named _sqlite3的问题全部内容,希望文章能够帮你解决解决No module named _sqlite3的问题所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)