hitrust / google-app-engine-django

Automatically exported from code.google.com/p/google-app-engine-django
Apache License 2.0
0 stars 0 forks source link

ImportError: No module named appengine.dist #142

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. make sure your computer runs the latest Ubuntu (9.10) with Python2.5, 
download and install the latest GAE SDK (1.2.7), download and install 
latest Django (1.1.1) in Python2.5, download and install the latest django 
helper (r95). 
2. make a symlink to the google_appengine directory with "ln -s 
/path/to/google_appengine/ .google_appengine" inside the django helper 
directory.
3. try to execute the following command: "python2.5 manage.py runserver"

What is the expected output? 

A barebone Django server running on http://localhost:8000/

What do you see instead?

Traceback (most recent call last):
  File "manage.py", line 18, in <module>
    InstallAppengineHelperForDjango()
  File "/home/fili/google-app-engine-django/appengine_django/__init__.py", 
line 505, in InstallAppengineHelperForDjango
    LoadDjango(version)
  File "/home/fili/google-app-engine-django/appengine_django/__init__.py", 
line 142, in LoadDjango
    from google.appengine.dist import use_library
ImportError: No module named appengine.dist

What version of the product are you using? On what operating system?

+ App Engine SDK 1.2.7 (although I had the same errors with 1.2.2 and 
1.2.5)
+ Python2.5 on Ubuntu 9.10 (this does work on Ubuntu 9.04)
+ Google App Engine Helper for Django r95

Please provide any additional information below.

In an effort trying to get help I documented more information here:
http://groups.google.com/group/google-appengine-
python/browse_thread/thread/54e0c2c7b8946115

Original issue reported on code.google.com by fili...@gmail.com on 2 Nov 2009 at 10:04

GoogleCodeExporter commented 9 years ago
I have same problem, on Ubuntu 9.10, Python 2.5.4 & Python 2.6.4rc2, App Engine 
SDK 1.2.7

Original comment by igor.art...@gmail.com on 5 Nov 2009 at 1:15

GoogleCodeExporter commented 9 years ago
in Ubuntu 9.10 google package imports from /usr/lib/pymodules/python2.5

> import google
> print google.__file__
/usr/lib/pymodules/python2.5/google/__init__.pyc

Original comment by aachu...@gmail.com on 5 Nov 2009 at 2:36

GoogleCodeExporter commented 9 years ago
For solving this problem just add

if sys.modules.has_key('google'):
  del sys.modules['google']

in appengine_django/__init__.py, line 85

=============================================================================
def LoadSdk():
  # Try to import the appengine code from the system path.
  try:
    from google.appengine.api import apiproxy_stub_map
  except ImportError, e:
    # force removing 'google' package
    if sys.modules.has_key('google'):    #<--- Ubuntu 9.10 fix
        del sys.modules['google']        #<--- Ubuntu 9.10 fix
    # Not on the system path. Build a list of alternative paths where it may be.
    # First look within the project for a local copy, then look for where the Mac
    # OS SDK installs it.

Original comment by aachu...@gmail.com on 5 Nov 2009 at 3:01

GoogleCodeExporter commented 9 years ago
Thanks, I can confirm this works for me. Is this going to be added to the next 
release? Thanks again for your help!

Original comment by fili...@gmail.com on 5 Nov 2009 at 3:35

GoogleCodeExporter commented 9 years ago
I confirm the problem and confirm the provided solution works

Original comment by thiagoga...@gmail.com on 15 Nov 2009 at 1:26

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r99.

Original comment by mattbrow...@gmail.com on 25 Nov 2009 at 1:31

GoogleCodeExporter commented 9 years ago
You may get this same exception in production (not locally) when upgrading to 
Python 2.7. Issue 205 may have clues

Original comment by kumar.mcmillan on 22 Jan 2013 at 8:01