Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

running package throws ImportError: No module named image

Tags:

cx-freeze

Using cx_freeze under ubuntu 12.04. The generation of the package is done without any errors but when I try to run the package as a standalone, I get the following error:

    Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/cx_Freeze/initscripts /Console.py",
    line 27, in <module>
    exec code in m.__dict__
     m m   File "Setup_cx_freeze.py", line 3, in <module>
     File "/usr/local/lib/python2.7/dist-packages/cx_Freeze/__init__.py",
     line 4, in <module>
     from cx_Freeze.dist import *
     File "/usr/local/lib/python2.7/dist-packages/cx_Freeze/dist.py",
     line 3, in <module>
     import distutils.command.install
      File "/usr/lib/python2.7/distutils/command/install.py", line 21,   in          <module>
      from site import USER_BASE
      File "/usr/lib/python2.7/site.py", line 562, in <module>
      main()
      File "/usr/lib/python2.7/site.py", line 540, in main
      abs__file__()
      File "/usr/lib/python2.7/site.py", line 100, in abs__file__
     m.__file__ = os.path.abspath(m.__file__)
     File "/usr/lib/python2.7/email/__init__.py", line 79, in __getattr__
      __import__(self.__name__)
      ImportError: No module named image

I think what to focus on is the last sentence. "ImportError: No module named image."

The application runs without any problems in pure python environment So why do I get the Error when running it as a "freeze" package? The fault is somehow introduced when generating the freeze-package.

like image 906
Gunnar Furugård Avatar asked Sep 27 '12 06:09

Gunnar Furugård


1 Answers

I ended up fixing this by explicitly including the package "email.mime" in the setup.py script build exe options.

like image 150
kellpossible Avatar answered Oct 21 '22 10:10

kellpossible