Well for the issue of not being able to find the site module, there a
couple of things going on.  First when FindPathHook in
dev_appserver.py calls hook(path_entry) it gets the exception
"zipimport.ZipImportError: not a Zip file", so it may be that
something somewhere (have a search running but haven't found it yet)
has it cached that C:\Tools\Python25\Lib\site-packages
\setuptools-0.6c8-py2.5.egg is a zip file.  Have a search going to
locate the culprit there.

Then this code in FindModuleRestricted:

    if (file_type not in (self._imp.C_BUILTIN, self._imp.C_EXTENSION)
and
        not FakeFile.IsFileAccessible(pathname)):
      error_message = 'Access to module file denied: %s' % pathname
      logging.debug(error_message)
      raise ImportError(error_message)

ends up raising this helpful exception, which then gets masked by a
generic exception by code above.

When I copy site.py back into the root of my project I see that C:
\Tools\Python25\Lib\site-packages\setuptools-0.6c8-py2.5.egg is on the
path, but it isn't available on the path_importer_cache so that's how
the code ends up going down the else to:

        else:
            try:
                stream = stream, path, descr = imp.find_module('site',
[item])

which then failed because imp does not have find_module.

On Sep 17, 2:02 pm, "Mike Orr" <[EMAIL PROTECTED]> wrote:
> On Wed, Sep 17, 2008 at 1:33 PM, Josh Heitzman <[EMAIL PROTECTED]> wrote:
>
> > I just uninstalled GAE SDK 1.1.1 and installed 1.1.3 and when I tried
> > to run my app I got the following error:
>
> >  File "c:\Tools\GAE\google\appengine\tools\dev_appserver.py", line
> > 1271, in LoadModuleRestricted
> >    description)
> >  File "d:\Enlistments\Prototypes\webgamesbyjosh\site.py", line 74, in
> > <module>
> >    __boot()
> >  File "d:\Enlistments\Prototypes\webgamesbyjosh\site.py", line 26, in
> > __boot
> >    stream, path, descr = imp.find_module('site',[item])
> > AttributeError: 'module' object has no attribute 'find_module'
>
> > If you are wondering why site.py is located at the root of my project,
> > its because I had wanted to edit the line generating the error:
>
> >                stream, path, descr = imp.find_module('site',[item])
>
> > to just read:
>
> >                stream = None
>
> > to see what happened, but setup tools was installed as zip.
>
> > After I deleted it and reinstalled it as flat file I kept getting an
> > import error regarding site (no I'm not running in an appmonkey
> > virtual env) even though adding a print >>sys.stderr, sys.path
> > statement right before import site statement in paste-deploy.py shows
> > that 'c:\\Tools\\Python25\\lib\\site-packages\\setuptools-0.6c8-
> > py2.5.egg' is on my path.  That directory does have site.py, which is
> > the source from which I copied site.py into my project root.
>
> > Anyway, after I did get the line above edited, the error I get now is:
>
> >  File "c:\Tools\GAE\google\appengine\tools\dev_appserver.py", line
> > 1271, in LoadModuleRestricted
> >    description)
> >  File "d:\Enlistments\Prototypes\webgamesbyjosh\site.py", line 73, in
> > <module>
> >    __boot()
> >  File "d:\Enlistments\Prototypes\webgamesbyjosh\site.py", line 38, in
> > __boot
> >    raise ImportError("Couldn't find the real 'site' module")
>
> > Anyone run into anything similar?
>
> > Anyone have any clue as to what might be going on here?
>
> No, but maybe you can run it under the Python debugger and see what
> that stack frame thinks sys.path and the current directory are, and
> whether you can manually import site (and your application) from
> there.
>
> --
> Mike Orr <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to