1

I am encountering problem with skimage (or scikit-image) and py2exe.

I am using WinPython-64bit-3.4.4.1, with Windows 10.

So here is my code : (I made it as simple as possible)

test.py

from skimage import data, filters
print("hello")

I enter this line in CMD :

py -m py2exe.build_exe test.py

(I tried to made a setup.py, but It change nothing)

and the error is :

Traceback (most recent call last):
  File "C:\WinPython-64bit-3.4.4.1\python-3.4.4.amd64\lib\runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
  File "C:\WinPython-64bit-3.4.4.1\python-3.4.4.amd64\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)

... 130 more similar lines...

  File "C:\WinPython-64bit-3.4.4.1\python-3.4.4.amd64\lib\site-packages\py2exe\mf3.py", line 281, in _find_and_load
self._gcd_import(parent)
  File "C:\WinPython-64bit-3.4.4.1\python-3.4.4.amd64\lib\site-packages\py2exe\mf3.py", line 267, in _gcd_import
return self._find_and_load(name)
  File "C:\WinPython-64bit-3.4.4.1\python-3.4.4.amd64\lib\site-packages\py2exe\mf3.py", line 286, in _find_and_load
  parent_module = self.modules[parent]
KeyError: 'matplotlib.externals.six.moves'

Before this error, I got a valueError: win32com.gen_py.loader is None, but I read somewhere that I just have to add this directory: [python directory]\Lib\site-packages\win32com\gen_py But since I add this directory, this error is gone.

However, I have no idea how to solve my current error... I find someone who had a similar problem, but his solution was to execute py2exe in a virtual machine...

Can you help me, please ?

SuperMouette
  • 345
  • 3
  • 13

1 Answers1

0

not sure it will change anything but you may try to:

  • launch "WinPython Command Prompt.exe"

  • type "python -m py2exe.build_exe test.py"

stonebig
  • 1,193
  • 1
  • 9
  • 13
  • Finally, I gave up py2exe, and I tried with pyInstaller. It give me better error, and things are well documented on their website... So, it's the module skimage.io which cause problem : imports seems to be weird... See this : http://stackoverflow.com/questions/34761862/pyinstaller-you-may-load-i-o-plugins-with-the-skimage-io-use-plugin – SuperMouette Apr 18 '16 at 18:44