简体   繁体   中英

File “/usr/lib/python2.7/importlib/__init__.py”, line 37, in import_module __import__(name) ImportError: No module named django

Here is my INSTALLED_APPS in settings

INSTALLED_APPS = (

'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
`'mongoengine.django.mongo_auth'`,
'django.contrib.formtools',

)

First django dependencies can be solved smoothly. It comes the problem when processing 'mongoengine.django.mongo_auth' . When I print out the name in import (name) in /usr/lib/python2.7/importlib/ init .py. The result is 'mongoengine.django'. I am pretty sure that django and mongoengine module is successfully installed.

So what the problem is? BTW, I use sudo to install module sudo pip install

Otherwise, it can not be installed because the modules are located in the root file directory.

Problem solved. New mongoengine did some modification.

pip uninstall mongoengine

and then install the older version

pip install mongoengine==0.9.0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM