[PythonCE] RE: shutil import failure
r_deeley at yahoo.com
Mon May 10 12:14:40 EDT 2004
OK. Some general thoughts on all this and some attempts at trying
to rationalize the problem a little more. Thanks for taking a look
Recall that it will work (ie not require a dll), if I provide the
shutil.py in the working directory. Then I get a .pyc and the program
But if I move the file that now works to the lib area, it will fail
again. Put it back in the user area, it works.
I don't know enough about how the python loading works, but it seems
to imply that somewhere there is a list of dependencies/rules that it
is checking. This list differs between the lib than the user area.
Presumably it applies rules to the user area first, then to the
lib area if nothing found in user area.
>From what I can see there are only 2 pyd files and 2 dll files in the
distribution. The main dll of interest is python22.dll. By its name
I would presume that everything that needs dll support is in there.
I would further guess that everything in the dll is available for any
invocation of python. I guess I am a little surprised by the reference
to shutil.dll, because I don't see any module specific dll's in my
distribution at all. Yet aside from shutil, things seem to be working
But if you just want shutil to work, put the shutil.py with your code and
let it compile that. So at the very least, we have a workaround for it.
(at least I seem to, does this work for anyone else ?). So why does it
require a dll in the first place ? (or conversely, why don't I have
any more than 2 dlls in my release).
Anyway, good to have had some input on all this. Hopefully the issue
will disappear on a future release.
--- Isr Gish <isrgish at fastem.com> wrote:
> Hi Richard.
> Richard Deeley wrote:
> >OK, The DOS console I have doesn't seem to support cut and
> >paste, so I will type it in here with as best as I can...
> >shell.py 553 in RunCode imp.load_module("__main__", file, fname, imp_params)
> >File (mine.py) line 2 in ?
> > from (anotherofmine.py) import *
> >File (anotherofmine.py), line 6 in ?
> > import shutil
> >NameError: Can't find file for module shutil
> >(filename shutil.dll)
> what I do see is that this is not a Import Error which is usually raised when you import a
> module thats not there. That seems to say that the problem is not with the actuall import but
> rather with some name in the imported file. The error message also seems to point to that by
> saying "Can't find *file* for module shutil (filename shutil.dll)"
> Which seems to say that file shutil.dll is missing.
> I would advise you to post this problem on the tutor list (tutor at python.org). You may need to
> sign up for it. Which can be done at http://mail.python.org/mailman/listinfo/tutor
> >Version is 2.2+ (#0 Jan 20 2002, 13:30:34) [MSC 32 bit (ARM)] on Pocket PC
> >(seems a little ancient seeing as I only downloaded it fairly recently)
> There is a newer version at:
> Scrooldown to the header named "PocketPC Programming"
> and there you will see a link named "http--debris.demon.nl-PythonCE-2.3"
> >Let me know if you need anything else on this...
> All the best,
> PythonCE mailing list
> PythonCE at python.org
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
More information about the PythonCE