1
Traceback (most recent call last):
 File "<string>", line 1, in <module>
File py_installer/PyInstaller-2.1/PyInstaller/loader/pyi_importers.py", line 270, in load_module
File py_installer/PyInstaller-2.1/FaceMatcher/build/FaceMatcher/out00-PYZ.pyz/proj_code", line 11, in <module>
File PyInstaller-2.1/PyInstaller/loader/pyi_importers.py", line 270, in load_module
File PyInstaller-2.1/FaceMatcher/build/FaceMatcher/out00-PYZ.pyz/skimage.transform", line 1, in <module>
File py_installer/PyInstaller-2.1/PyInstaller/loader/pyi_importers.py", line 270, in load_module
File py_installer/PyInstaller-2.1/FaceMatcher/build/FaceMatcher/out00-PYZ.pyz/skimage.transform.hough_transform", line 7, in <module>
File py_installer/PyInstaller-2.1/PyInstaller/loader/pyi_importers.py", line 409, in load_module
File "_hough_transform.pyx", line 13, in init skimage.transform._hough_transform (skimage/transform/_hough_transform.c:7337)
File "py_installer/PyInstaller-2.1/PyInstaller/loader/pyi_importers.py", line 270, in load_module
File "py_installer/PyInstaller-2.1/FaceMatcher/build/FaceMatcher/out00-PYZ.pyz/skimage.draw", line 1, in <module>
File "py_installer/PyInstaller-2.1/PyInstaller/loader/pyi_importers.py", line 409, in  load_module
File "_draw.pyx", line 1, in init skimage.draw._draw (skimage/draw/_draw.c:7257)





ImportError: No module named geometry

I have been getting above error. Could some one please tell me how would i fix it?

5
  • please check geometry is installed or not? Commented Mar 17, 2014 at 13:32
  • there is nothing called geomtry module. I tried to import geometry , it could not find. Commented Mar 17, 2014 at 13:43
  • But there is module called sympy.geometry installed. Commented Mar 17, 2014 at 13:45
  • try this on python console >>> from sympy.geometry import * and check its give error or not. Commented Mar 17, 2014 at 13:47
  • It does not show any error. Commented Mar 17, 2014 at 13:50

1 Answer 1

5

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.

Sign up to request clarification or add additional context in comments.

1 Comment

FWIW I've submitted a pull request to the pyinstaller project to get a modified version of this hook file included in the next release. You can follow the progress here, github.com/pyinstaller/pyinstaller/pull/120

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.