pmneila/PyMCubes

build error

bendichter opened this issue · 4 comments

Hi,

I get the following build error:

python setup.py build
Traceback (most recent call last):
  File "setup.py", line 52, in <module>
    ext_modules=cythonize(mcubes_module),
  File "/Users/bendichter/anaconda/envs/python2/lib/python2.7/site-packages/Cython/Build/Dependencies.py", line 818, in cythonize
    aliases=aliases)
  File "/Users/bendichter/anaconda/envs/python2/lib/python2.7/site-packages/Cython/Build/Dependencies.py", line 648, in create_extension_list
    elif isinstance(patterns, basestring) or not isinstance(patterns, collections.Iterable):
  File "/Users/bendichter/anaconda/envs/python2/lib/python2.7/abc.py", line 144, in __instancecheck__
    return cls.__subclasscheck__(subtype)
  File "/Users/bendichter/anaconda/envs/python2/lib/python2.7/abc.py", line 180, in __subclasscheck__
    if issubclass(subclass, scls):
  File "/Users/bendichter/anaconda/envs/python2/lib/python2.7/abc.py", line 180, in __subclasscheck__
    if issubclass(subclass, scls):
  File "/Users/bendichter/anaconda/envs/python2/lib/python2.7/abc.py", line 161, in __subclasscheck__
    ok = cls.__subclasshook__(subclass)
  File "/Users/bendichter/anaconda/envs/python2/lib/python2.7/site-packages/backports_abc.py", line 66, in __subclasshook__
    mro = C.__mro__
AttributeError: class Extension has no attribute '__mro__'

OSX

python: Python 2.7.11 |Anaconda custom (x86_64)| (default, Dec 6 2015, 18:57:58)

gcc:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

This is a known (and fixed) bug in Cython. See cython/cython#1507 and cython/backports_abc#7. It seems you are using an old version of Cython. Can you update your Anaconda packages?

I made a fresh conda venv with numpy 1.12.1, Cython 0.25.2, backports-abc-0.5, and python 2.7. Still no dice... I realize this is a problem with cython/backports-abc, so feel free to close.

I got it working. In case anyone else runs into the same error, here's what I think happened: I am using a venv and I was importing numpy in my ipython_config file. I think it was importing the wrong numpy. When I removed that line the import worked as expected. Thanks for the help, @pmneila!