Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. Traceback (most recent call last):
  2. File "manage.py", line 8, in <module>
  3. from django.core.management import execute_from_command_line
  4. ModuleNotFoundError: No module named 'django'
  5.  
  6. During handling of the above exception, another exception occurred:
  7.  
  8. Traceback (most recent call last):
  9. File "manage.py", line 14, in <module>
  10. import django
  11. ModuleNotFoundError: No module named 'django'
  12.  
  13. During handling of the above exception, another exception occurred:
  14.  
  15. Traceback (most recent call last):
  16. File "manage.py", line 17, in <module>
  17. "Couldn't import Django. Are you sure it's installed and "
  18. 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?
  19.  
  20. python -m django --version
  21. it confirmed that django is not there with the following msg:
  22. /Library/Frameworks/Python.framework/Versions/3.7/bin/python3: No module named django
  23.  
  24. #!/usr/bin/env python
  25. import os
  26. import sys
  27.  
  28. if __name__ == "__main__":
  29. os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xxx.settings")
  30. try:
  31. from django.core.management import execute_from_command_line
  32. except ImportError:
  33. # The above import may fail for some other reason. Ensure that the
  34. # issue is really that Django is missing to avoid masking other
  35. # exceptions on Python 2.
  36. try:
  37. import django
  38. except ImportError:
  39. raise ImportError(
  40. "Couldn't import Django. Are you sure it's installed and "
  41. "available on your PYTHONPATH environment variable? Did you "
  42. "forget to activate a virtual environment?"
  43. )
  44. raise
  45. execute_from_command_line(sys.argv)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement