1

I am using ubuntu 16.04. Now I am starting my first Django project. Please check this error:

(unix-9PXH2taC) unix@unix:~/Desktop/django/test_project$** python manage.py runserver
Traceback (most recent call last):
File "manage.py", line 8, in <module>
from django.core.management import execute_from_command_line
ImportError: No module named 'django'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "manage.py", line 14, in <module>
) from exc
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?

What is going wrong?

CKE
  • 1,533
  • 19
  • 18
  • 29
Jerald Jacob
  • 77
  • 2
  • 10

1 Answers1

0

How did you install it ?

For pip and conda, check if you are in correct environment.

If you did an apt install (or apt-get install), the PYTHONPATH is not reflected until you source .bashrc in your home directory. Log-out and log-in (or type source ~/.bashrc in your terminal).

Edward Aung
  • 3,014
  • 1
  • 12
  • 15