McMillan's installer & new module

Tim Hochberg tim.hochberg at ieee.org
Thu Jan 18 09:36:06 EST 2001


I meant to post this to the group in response to Arpad's original question,
but goofed and sent it directly to him instead. If the problem you're having
is that the executable the installer is creating won't find buitin modules
such as new, math, etc., this may help.

-----------------------------------------------------------------

From: "Arpad Kiss" <sekter at matavnet.hu>

> Hi,
> I have installed Python 2.0 and McMillan's installer(version 3i) on Win NT
> 4.0 sp6.
> If I use Standalone.py to create a standalone exe and my script contains
> only "import new" then the generated exe raises an error message:
> ImportError: No module named new
> Any idea?

This is a bug in the current installer which Gordon is aware of and will
presumably fix in an upcoming release. In the meantime, one way to fix this
is to add the following magic incantation to the top of your main script:

import sys, imputil
sys.path.append(imputil.BuiltinImporter())

One could presumably also fix this by editing Builder.py, and I believe this
is what Gordon has recomended to people who have asked him about it, but I
haven't looked into this myself.

Hope that does the trick for you.

-tim

-----------------------------------------------------------------

"Dan Rolander" <dan.rolander at marriott.com> wrote in message
news:mailman.979754736.14513.python-list at python.org...
> I've played around with Gordon's Installer a bit, but have gotten stuck
when
> it can't find all the modules I need. He does have a lot of information on
> his web site but I'm not sure I understand all of it. Is there a better
way
> to package Python scripts into standalone exe's for Win32? I've read a
> little about freeze, squeeze, distutils, etc. but haven't tried them.
>
> Any thoughts?
>
> Thanks,
> Dan
>
> ----- Original Message -----
> From: "Pete Shinners" <shredwheat at mediaone.net>
> Newsgroups: comp.lang.python
> To: <python-list at python.org>
> Sent: Wednesday, January 17, 2001 12:18 PM
> Subject: Re: McMillan's installer & new module
>
>
> > "Arpad Kiss" <sekter at matavnet.hu> wrote
> > > I have installed Python 2.0 and McMillan's installer(version 3i) on
Win
> NT
> > > 4.0 sp6.
> > > If I use Standalone.py to create a standalone exe and my script
contains
> > > only "import new" then the generated exe raises an error message:
> > > ImportError: No module named new
> >
> > last i heard from gordon, there is definitely a problem with the
> > latest installer when it tries to import the builtin modules
> > (time, new, etc).
> > gordon seems pretty busy these days and said a new version would
> > be available whenever he can get around to it.
> >
> >
> >
> > --
> > http://mail.python.org/mailman/listinfo/python-list
> >
>
>





More information about the Python-list mailing list