Skip to content Skip to sidebar Skip to footer

Importerror: No Module Named Geometry While Running Executables Obtained From Pyinstaller

Traceback (most recent call last): File '', line 1, in File py_installer/PyInstaller-2.1/PyInstaller/loader/pyi_importers.py', line 270, in load_modul

Solution 1:

The problem is skimage.transform requires on a small 'chain' of hidden imports. These are imports that happen in a variety of ways Pyinstaller cannot detect automatically, namely using __import__, etc. So, you must tell Pyinstaller directly about these imports so it knows to inspect them and add them to your build.

You can do this in two ways:

  1. The --hidden-import command-line flag, which is useful if you have only a few modules to specify.
  2. 'hook' files, which can help you group a few hidden imports based on what module requires them.

For example, for your specific situation you can create a file called hook-skimage.transform.py and put the following in it:

hiddenimports = ['skimage.draw.draw',
                 'skimage.draw._draw',
                 'skimage.draw.draw3d',
                 'skimage._shared.geometry',
                 'skimage._shared.interpolation',
                 'skimage.filter.rank.core_cy']

You may not need all of those modules specified. Your build was only lacking skimage._shared.geometry so you could try only including that file with the --hidden-import command-line flag, or only including skimage._shared.geometry in your hook-skimage.transform.py file. However, those specific hidden imports fixed my scenario on Windows 7 64-bit with skimage 0.9.3.

Then, tell pyinstaller where to look for your extra hook files. So, if you put the hook-skimage.transform.py file in your '.' directory you need to modify your pyinstaller build command to include --additional-hooks-dir=.

This will cause pyinstaller to inspect the modules you specified when it tries to import skimage.transform.hough_line as your output mentioned.

Post a Comment for "Importerror: No Module Named Geometry While Running Executables Obtained From Pyinstaller"