1
votes

I am trying to install simpleITK on my macbook which has mavericks running on it. I have installed Anaconda python.

When I try to import SimpleITK as sitk, I get the following error

import SimpleITK as sitk

Traceback (most recent call last): File "", line 1, in File "/Users/dagarshali/anaconda/lib/python2.7/site-packages/SimpleITK-0.8.0.post29-py2.7-macosx-10.5-x86_64.egg/SimpleITK/init.py", line 1, in from .SimpleITK import * File "/Users/dagarshali/anaconda/lib/python2.7/site-packages/SimpleITK-0.8.0.post29-py2.7-macosx-10.5-x86_64.egg/SimpleITK/SimpleITK.py", line 28, in _SimpleITK = swig_import_helper() File "/Users/dagarshali/anaconda/lib/python2.7/site-packages/SimpleITK-0.8.0.post29-py2.7-macosx-10.5-x86_64.egg/SimpleITK/SimpleITK.py", line 24, in swig_import_helper _mod = imp.load_module('_SimpleITK', fp, pathname, description) ImportError: dlopen(/Users/dagarshali/anaconda/lib/python2.7/site-packages/SimpleITK-0.8.0.post29-py2.7-macosx-10.5-x86_64.egg/SimpleITK/_SimpleITK.so, 2): Library not loaded: libpng15.15.dylib Referenced from: /Users/dagarshali/anaconda/lib/python2.7/site-packages/SimpleITK-0.8.0.post29-py2.7-macosx-10.5-x86_64.egg/SimpleITK/_SimpleITK.so Reason: image not found

Not sure how to fix this problem.

Any suggestions?

Best regards, Vishwa

2
Better post on sitk and/or anaconda bug sites or forums. Unfortunately, many things are tested under linux and then fail under mac.mdurant
Had the same frustrating problem a while ago... I had to remove anaconda (completely remove), then reinstall SimpleITK. I suggest you to not use the operative system python, the one under /System/Library/Frameworks/Library.framework/Versions/blabla, but to download a new python from python.org/downloads, that will go under /Library/Frameworks/Library.framework/Versions/blabla. Even better, use virtualenvironments. (in both cases to me worked only with anaconda out of the way).SeF

2 Answers

1
votes

I am guessing here that you compiled SimpleITK yourself and have conflicting libraries for Anaconda and the system.

Binaries for the Anaconda distribution are now available in Binstar: https://binstar.org/simpleitk

0
votes

It was built using an older version of limping On your virtual environment, try to downgrade libpng:

conda install libpng=1.5.13