Python Forum
ImportError: No module named django.core.exceptions in google app engine
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ImportError: No module named django.core.exceptions in google app engine
#1
djangoforms.py module was missing from google.appengine.ext.db. So I manually putted the module there from net. But it can't import django.core.exceptions. I've two version of python installed in my windows 10 and have added python 2.7 on the path. IDLE 2.7 successfully runs [pyhton]import django[/python] . Below is the log console message of google app engine. Have googled numerous times but couldn't find any fruitful solution. Any help?[I'm a newbie who is learning from head first python(1st edition)]


Error:
ERROR 2018-06-18 09:47:26,513 cgi.py:122] Traceback (most recent call last): File "F:\Coding Practise\head_first_series\python\ch10_tariq\hfwwgapp\hfwwg.py", line 5, in <module> from google.appengine.ext.db import djangoforms File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\db\djangoforms.py", line 98, in <module> import django.core.exceptions ImportError: No module named django.core.exceptions
Reply
#2
did you ever install django?
Are you in a virtual environment?
django.core.exceptions is part of the django package.
to install, you must be running a shell in the virtual environment, then call:
pip install django
Reply
#3
I've installed django.
running "import django" does not give me any error message in idle.
Reply
#4
C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\django is present with init.py .....doesn't it mean that django is already installed in app engine?! ...but import django shows an import error.
Reply
#5
Usually Django is run from a virtual environment. If your django project is being run from a virtual environment, it has to be installed in the virtual environment as well.

If you are going to be using Django, use an IDE that is virtual environment friendly, such as VS Code. It will save you a lot of grief in exchange for a few hours of learning pain.
see: https://python-forum.io/Thread-VS-Code-E...ht=vs+code

a Virtual Environment is isolated from other software on your system. This is what makes it so useful. When you are done with your code, you can create a master package that won't have the overhead of unneeded and unused packages.

Your code will have it's own copy of python, Django (but you have to install it while in virtual environment), and any other needed package.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  No module named theapp Clives 10 5,826 Jun-10-2021, 11:16 AM
Last Post: Larz60+
  flask How to output stderr and exceptions to log file umen 4 4,771 Jun-20-2020, 06:11 AM
Last Post: umen
  Automation Engine on Python? jfha73 4 2,097 May-01-2020, 02:29 PM
Last Post: jfha73
  ModuleNotFoundError: No module named "requests" BushFacts 1 5,130 Jan-13-2020, 06:49 AM
Last Post: perfringo
  Django getting ModuleNotFoundError: No module named '=' Malt 0 2,951 Aug-30-2019, 08:34 AM
Last Post: Malt
  Django: How to automatically substitute a variable in the admin page at Django 1.11? m0ntecr1st0 3 3,306 Jun-30-2019, 12:21 AM
Last Post: scidam
  Session engine in Django karansingh 1 2,045 May-02-2019, 04:07 AM
Last Post: animeshagrawal28
  No module named flask_themes voipsense 4 4,812 Feb-25-2019, 06:54 PM
Last Post: voipsense
  requests - handling exceptions Truman 2 2,833 Nov-13-2018, 11:54 PM
Last Post: Truman
  About .profile and ImportError: No module named RicardoAbdala 1 3,140 Aug-28-2018, 05:32 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020