linhaoran / gae-pytz

Automatically exported from code.google.com/p/gae-pytz
MIT License
0 stars 0 forks source link

pytz bad import, setuptools issue? #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I'm trying to load gae-pytz with the following command:

from pytz.gae import pytz

When that happens I get the following import error below.  Is this a setuptools 
issue? Any ideas?

ERROR:root:
Traceback (most recent call last):
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 193, in Handle
    result = handler(self._environ, self._StartResponse)
  File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\django\contrib\staticfiles\handlers.py", l
ine 68, in __call__
    return self.application(environ, start_response)
  File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\django\core\handlers\wsgi.py", line 250, i
n __call__
    self.load_middleware()
  File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\django\core\handlers\base.py", line 45, in
 load_middleware
    mod = import_module(mw_module)
  File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\django\utils\importlib.py", line 35, in im
port_module
    __import__(name)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1845,
in load_module
    return self.FindAndLoadModule(submodule, fullname, search_path)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1717,
in FindAndLoadModule
    description)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1660,
in LoadModuleRestricted
    description)
  File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\autoload\middleware.py", line 8, in <modul
e>
    import_module('%s.models' % (app))
  File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\django\utils\importlib.py", line 35, in im
port_module
    __import__(name)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1845,
in load_module
    return self.FindAndLoadModule(submodule, fullname, search_path)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1717,
in FindAndLoadModule
    description)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1660,
in LoadModuleRestricted
    description)
  File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\updater\models.py", line 4, in <module>
    from pytz.gae import pytz
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1845,
in load_module
    return self.FindAndLoadModule(submodule, fullname, search_path)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1717,
in FindAndLoadModule
    description)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1660,
in LoadModuleRestricted
    description)
  File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\libs\pytz\__init__.py", line 34, in <modul
e>
    from pkg_resources import resource_stream
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1845,
in load_module
    return self.FindAndLoadModule(submodule, fullname, search_path)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1717,
in FindAndLoadModule
    description)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1642,
in LoadModuleRestricted
    return source_file.load_module(submodule_fullname)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\dist\py_zipimport.py", line 246, in load_module
    submodname, is_package, fullpath, source = self._get_source(fullmodname)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\dist\py_zipimport.py", line 207, in _get_source
    source = self.zipfile.read(relpath.replace(os.sep, '/'))
  File "C:\Python27\lib\zipfile.py", line 867, in read
    return self.open(name, "r", pwd).read()
  File "C:\Python27\lib\zipfile.py", line 882, in open
    zef_file = open(self.filename, 'rb')
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 592, i
n __init__
    raise IOError(errno.EACCES, 'file not accessible', filename)
IOError: [Errno 13] file not accessible: 
'C:\\Python27\\lib\\site-packages\\setuptools-0.6c11-py2.7.egg'
INFO:root:"GET /invoice/ HTTP/1.1" 500 -
ERROR:root:
Traceback (most recent call last):
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 193, in Handle
    result = handler(self._environ, self._StartResponse)
  File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\django\contrib\staticfiles\handlers.py", l
ine 68, in __call__
    return self.application(environ, start_response)
  File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\django\core\handlers\wsgi.py", line 250, i
n __call__
    self.load_middleware()
  File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\django\core\handlers\base.py", line 45, in
 load_middleware
    mod = import_module(mw_module)
  File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\django\utils\importlib.py", line 35, in im
port_module
    __import__(name)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1845,
in load_module
    return self.FindAndLoadModule(submodule, fullname, search_path)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1717,
in FindAndLoadModule
    description)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1660,
in LoadModuleRestricted
    description)
  File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\autoload\middleware.py", line 8, in <modul
e>
    import_module('%s.models' % (app))
  File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\django\utils\importlib.py", line 35, in im
port_module
    __import__(name)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1845,
in load_module
    return self.FindAndLoadModule(submodule, fullname, search_path)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1717,
in FindAndLoadModule
    description)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1660,
in LoadModuleRestricted
    description)
  File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\updater\models.py", line 4, in <module>
    from pytz.gae import pytz
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1845,
in load_module
    return self.FindAndLoadModule(submodule, fullname, search_path)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1717,
in FindAndLoadModule
    description)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1660,
in LoadModuleRestricted
    description)
  File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\libs\pytz\__init__.py", line 34, in <modul
e>
    from pkg_resources import resource_stream
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1845,
in load_module
    return self.FindAndLoadModule(submodule, fullname, search_path)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1717,
in FindAndLoadModule
    description)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1642,
in LoadModuleRestricted
    return source_file.load_module(submodule_fullname)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\dist\py_zipimport.py", line 246, in load_module
    submodname, is_package, fullpath, source = self._get_source(fullmodname)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\dist\py_zipimport.py", line 207, in _get_source
    source = self.zipfile.read(relpath.replace(os.sep, '/'))
  File "C:\Python27\lib\zipfile.py", line 867, in read
    return self.open(name, "r", pwd).read()
  File "C:\Python27\lib\zipfile.py", line 882, in open
    zef_file = open(self.filename, 'rb')
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 592, i
n __init__
    raise IOError(errno.EACCES, 'file not accessible', filename)
IOError: [Errno 13] file not accessible: 
'C:\\Python27\\lib\\site-packages\\setuptools-0.6c11-py2.7.egg'
INFO:root:"GET /invoice/ HTTP/1.1" 500 -

Original issue reported on code.google.com by michael....@gmail.com on 3 Apr 2012 at 2:27

GoogleCodeExporter commented 8 years ago
I copied the error twice there.

Original comment by michael....@gmail.com on 3 Apr 2012 at 2:28

GoogleCodeExporter commented 8 years ago
BTW, the file c:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg exists 
on my computer.

Original comment by michael....@gmail.com on 3 Apr 2012 at 2:31

GoogleCodeExporter commented 8 years ago
Sorry, never-mind. I just had to restart the server.

Original comment by michael....@gmail.com on 3 Apr 2012 at 2:33

GoogleCodeExporter commented 8 years ago
Hmm... I take that back. Restarting the server does work, but now I have to 
restart the server every time I make a change. What's going on?

Original comment by michael....@gmail.com on 3 Apr 2012 at 2:37

GoogleCodeExporter commented 8 years ago
I'm getting the exact same problem. Any ideas of a fix?

Original comment by rattray....@gmail.com on 19 Jul 2012 at 7:47

GoogleCodeExporter commented 8 years ago
Same here.  No help on StackOverflow yet either: 
http://stackoverflow.com/questions/8956712/gae-python-dev-server-crashes-intermi
ttently-after-upgrade-to-2-7

Original comment by jeff.oneill on 29 Jul 2012 at 6:03

GoogleCodeExporter commented 8 years ago
There is a fix at the StackOverflow link in comment 6.  There is a simple patch 
there that should be added to gae-pytz.

Original comment by jeff.oneill on 23 Dec 2012 at 6:56