I have installed Django(1.8.2) in my Ubuntu 16.04.
When I cloned a working project into it and run the server, I got the following error.
Traceback (most recent call last):
File "manage.py", line 31, in <module>
execute_from_command_line(sys.argv)
File "/usr/lib/python2.7/django/core/management/__init__.py", line 338, in execute_from_command_line
utility.execute()
File "/usr/lib/python2.7/django/core/management/__init__.py", line 312, in execute
django.setup()
File "/usr/lib/python2.7/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/lib/python2.7/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/usr/lib/python2.7/django/apps/config.py", line 119, in create
import_module(entry)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named django
Observation(s):
- I'm able to start a new project and run the server of the same.
The value of
INSTALLED_APPSinsettings.pyis:INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'Telecommands', 'Telemetry', 'captcha', 'django.contrib.sitemaps', 'djcelery', 'kombu.transport.django', # 'grappelli', # 'chronograph', # 'registration', # Include the registration )
What have I tried?
- Installing django using
pip install django==1.8.2. - Since the error was reported with reference to
/usr/lib/python2.7/,
I tried:
sudo pip install --install-option="--install-purelib=/usr/lib/python2.7/site-packages/" --ignore-installed django==1.8.2 - Further, when I got confused with paths
/usr/local/lib/python2.7/dist-packages,
/usr/lib/python2.7/dist-packages/
and~/.local/lib/python2.7/dist-packages.
I installed django(1.8.2) to each of these paths one by one,
updatingPYTHONPATHin parallel. - I did not get any errors while installing.
Can somebody help me out. Kindly explain the reason for the error as well.
INSTALLED_APPSvaule.