Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No module named machinery

Tags:

python

py2exe

I am trying to make exe using py2exe in Python. When I import py2exe I am getting error like this:

Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import py2exe
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\py2exe-0.9.2.0-py2.7-win32.egg\py2exe\__init__.py", line 9, in <module>
    patch_distutils()
  File "C:\Python27\lib\site-packages\py2exe-0.9.2.0-py2.7-win32.egg\py2exe\patch_distutils.py", line 68, in patch_distutils
    from . import distutils_buildexe
  File "C:\Python27\lib\site-packages\py2exe-0.9.2.0-py2.7-win32.egg\py2exe\distutils_buildexe.py", line 91, in <module>
    from . import runtime
  File "C:\Python27\lib\site-packages\py2exe-0.9.2.0-py2.7-win32.egg\py2exe\runtime.py", line 3, in <module>
    from .dllfinder import Scanner, pydll
  File "C:\Python27\lib\site-packages\py2exe-0.9.2.0-py2.7-win32.egg\py2exe\dllfinder.py", line 7, in <module>
    from importlib.machinery import EXTENSION_SUFFIXES
ImportError: No module named machinery

Can any body help me fixing this out. I am not getting machinery module any where.

like image 527
Anand Avatar asked Jun 16 '14 05:06

Anand


2 Answers

I just ran into this myself. I had installed 0.9 from pypi as well. If you look at the pypi page here py2exe on pypi, you'll see that the download only supports Python 3.3 and later and you should use the 0.6 download from here. I deleted the 0.9 egg after installing 0.6 and it worked after that.

like image 55
Lee Kamentsky Avatar answered Nov 18 '22 20:11

Lee Kamentsky


I had same issue, because i had version py2exe0.9 and it is not supported for python2.7.

I downloaded lower version from here http://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/py2exe-0.6.9.win32-py2.7.exe/download

and it works.

like image 44
jatinkumar patel Avatar answered Nov 18 '22 20:11

jatinkumar patel