Install difficulties - No module named _hough_transform

291 views
Skip to first unread message

james.a.f...@googlemail.com

unread,
Feb 14, 2015, 9:35:31 AM2/14/15
to scikit...@googlegroups.com
Hi,

I'm trying to install skimage, and having installed the dependencies (from requirements.txt in the source release), and then using pip to install skimage itself, I am having problems importing the transform library:

Python 2.7.2 (default, Oct 11 2012, 20:14:37) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import skimage.data
>>> import skimage.transform
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "skimage/transform/__init__.py", line 1, in <module>
    from ._hough_transform import (hough_ellipse, hough_line,
ImportError: No module named _hough_transform

This is on Mac OSX 10.8.4 with Python 2.7.2.  Is this an external library that needs installing from somewhere else?  I have already had to install tifffile separately to get skimage.data working (perhaps should be added to requirements.txt?).  I've tried a variety of approaches, but haven't had any success.

Any and all advice welcome!

Yours,
James.

james.a.f...@googlemail.com

unread,
Feb 14, 2015, 9:40:00 AM2/14/15
to scikit...@googlegroups.com
Further, it appears more things are missing from the pip install:

>>> import skimage
>>> print skimage.__version__
0.11dev

>>> from skimage.feature import blob_dog, blob_log, blob_doh
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "skimage/feature/__init__.py", line 2, in <module>
    from ._daisy import daisy
  File "skimage/feature/_daisy.py", line 4, in <module>
    from .. import img_as_float, draw
  File "skimage/draw/__init__.py", line 1, in <module>
    from .draw import circle, ellipse, set_color
  File "skimage/draw/draw.py", line 3, in <module>
    from ._draw import _coords_inside_image
ImportError: No module named _draw

This isn't particularly neat; it appears the dependencies aren't being fulfilled, or that the binaries available from pip are incomplete (the version 0.11dev raises suspicion).  If I attempt to download the source and build, I get the following error:

building 'skimage._shared.geometry' extension
compiling C sources
C compiler: clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe

compile options: '-I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'
clang: geometry.c
clang: error: no such file or directory: 'geometry.c'

Which again implies something is missing, either from the dependencies or the source distribution.  I can't find mention of a 'geometry' library that would fix this...

Yours,
James.

Josh Warner

unread,
Feb 14, 2015, 11:51:18 AM2/14/15
to scikit...@googlegroups.com
Hi James,

These are Cython modules that aren't being found or are not properly compiling. Please let us know what version of Cython you are running.

Rest assured the modules are there. These are not external dependencies. I suspect an old version of Cython is to blame.


Regards,

James Jackson

unread,
Feb 14, 2015, 12:17:56 PM2/14/15
to scikit...@googlegroups.com
Josh,

Thanks for the reply - I've just installed cython using the requirements file so should be up-to-date.  Looking back at my install log, it seems I've got the latest (0.22).

Collecting cython>=0.21 (from -r requirements.txt (line 1))
  Downloading Cython-0.22-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (3.7MB)

Looking in the site-packages directory I do see a _hough_transform library:

James-Jacksons-MacBook-Air:transform jamesjackson$ pwd
/Library/Python/2.7/site-packages/skimage/transform
James-Jacksons-MacBook-Air:transform jamesjackson$ ll | grep hough
-rwxr-xr-x   1 root  wheel  659580 14 Feb 09:41 _hough_transform.so
-rw-r--r--   1 root  wheel    5566 14 Feb 09:41 hough_transform.py
-rw-r--r--   1 root  wheel    5044 14 Feb 09:41 hough_transform.pyc

So something funny is clearly going on here with it not being picked up...

Yours,
James.

--
You received this message because you are subscribed to a topic in the Google Groups "scikit-image" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scikit-image/anOjoI4jW-w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scikit-image...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

James Jackson

unread,
Feb 14, 2015, 12:21:08 PM2/14/15
to scikit...@googlegroups.com
Just tinkering, I wondered if this was related to having multiple versions of Python installed.  When auto-config / build scripts are being run I always have a niggling feeling of unease in a multiple-version environment.  Looking at the multi-version support in OS X, I came across this nugget to set a global default version to execute:

sudo defaults write /Library/Preferences/com.apple.versioner.python Version 2.7

It looks like the modules are now importing properly.  Perhaps worth adding to the install page as a Mac OS X note?

Yours,
James.

Johannes Schoenberger

unread,
Feb 14, 2015, 12:32:55 PM2/14/15
to scikit...@googlegroups.com
Just to make sure: Do you try to import skimage from within the scikit-image source directory?
> You received this message because you are subscribed to the Google Groups "scikit-image" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image...@googlegroups.com.

James Jackson

unread,
Feb 14, 2015, 1:10:58 PM2/14/15
to scikit...@googlegroups.com
Johannes,

No, having performed a global install I am sitting in another unrelated directory.

Yours,
James.
Reply all
Reply to author
Forward
0 new messages