#34 py2exe 0.5.0 raises ImportError: no module named

closed
nobody
None
5
2004-11-18
2004-01-18
No

I'm using py2exe to build an executable for a program
called Howie (http://howie.sourceforge.net). Version
0.4.2 has worked for months, but when I upgraded to
v0.5.0 I started getting an exception when I
run "setup.py py2exe":

------------------------------------------------------
running py2exe
*** searching for required modules ***
Traceback (most recent call last):
File "C:\code\howie\setup.py", line 15, in ?
data_files=[
File "C:\PROGRA~1\Python\lib\distutils\core.py", line
149, in setup
dist.run_commands()
File "C:\PROGRA~1\Python\lib\distutils\dist.py", line
907, in run_commands
self.run_command(cmd)
File "C:\PROGRA~1\Python\lib\distutils\dist.py", line
927, in run_command
cmd_obj.run()
File "C:\PROGRA~1\Python\Lib\site-
packages\py2exe\build_exe.py", line 187, in
run
self.find_needed_modules(mf, required_files,
required_modules)
File "C:\PROGRA~1\Python\Lib\site-
packages\py2exe\build_exe.py", line 826, in
find_needed_modules
mf.import_hook(mod)
File "C:\PROGRA~1\Python\lib\modulefinder.py", line
124, in import_hook
q, tail = self.find_head_package(parent, name)
File "C:\PROGRA~1\Python\lib\modulefinder.py", line
178, in find_head_package
raise ImportError, "No module named " + qname
ImportError: No module named
------------------------------------------

Yup, it can't find a module named....nothing. Any idea
what could be causing this? You should be able to get
the latest Howie source from Sourceforge CVS and try it
yourself if you need more context.

Discussion

  • Thomas Heller

    Thomas Heller - 2004-01-30

    Logged In: YES
    user_id=11105

    I could not reproduce your problem. The next step would be
    that you insert some print statements into modulefinder, to
    find out what it's doing (or use another way to debug this).

    BTW: There's a unresolved bug in modulefinder which is
    triggered when Jason Orendorff's path.py module is installed
    in lib/site-packages.

     
  • Thomas Heller

    Thomas Heller - 2004-01-30
    • summary: py2exe 0.5.0 raises ImportError: no module named "" --> py2exe 0.5.0 raises ImportError: no module named
     
  • Thomas Heller

    Thomas Heller - 2004-06-01
    • status: open --> closed
     
  • Thomas Heller

    Thomas Heller - 2004-06-01

    Logged In: YES
    user_id=11105

    No response, closing.

     
  • Anonymous - 2004-08-09
    • status: closed --> open
     
  • Anonymous - 2004-08-09

    Logged In: YES
    user_id=30947

    FWIW, I did finally figure out what was going on here. I had
    the following line my project's setup.cfg file:

    includes=

    While earlier versions of py2exe handled this just fine, as of
    version 0.5.0 this caused an empty string to be inserted in
    the py2exe class's self.includes list. When this empty string
    was passed to modulefinder.import_hook() (build_exe.py,
    line 924), the function throws an exception.

    So the problem was bad input data on my side. However, it
    would be pretty easy for py2exe to protect itself against
    idiotic users like me by stripping out any obviously invalid
    modules from its lists before passing them to import_hook()?

     
  • Thomas Heller

    Thomas Heller - 2004-11-18

    Logged In: YES
    user_id=11105

    I thought this was already closed?

     
  • Thomas Heller

    Thomas Heller - 2004-11-18
    • status: open --> closed
     
  • Anonymous - 2004-11-18

    Logged In: YES
    user_id=30947

    It was closed because I was a lazy bum and didn't reply to
    your initial request for more information. The problem I
    described in my most recent comment is still present.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks