[ITK-users] Simple ITK Python not working on Mac El Capitan (10.11)

Lowekamp, Bradley (NIH/NLM/LHC) [C] blowekamp at mail.nih.gov
Fri Jun 17 14:05:25 EDT 2016


Hi,

Where did you get you python from? You are using a version from /Library/Framework/Python.frameworks, which is not the system version.

The error with the first command gives you a suggestion on how to solve the problem. 

The second error appears to be a binary compatibility issue with the distribution you have of python.

Please read the guidance on the wiki with the different distributions of python, along with following the recommendation to setup a virtual environment.

https://itk.org/Wiki/SimpleITK/GettingStarted

Good luck,
Brad




> On Jun 17, 2016, at 11:20 AM, paniwani <paniwani at gmail.com> wrote:
> 
> Hi, 
> 
> It appears the code that I pasted did not show up in the email version of
> the mailing list. I've re-pasted below. I'm using system Python 2.7 and Mac
> OSX El Capitan. Thank you!
> 
> -----
> 
> I was using simple ITK with python in my application with no problems until
> I recently upgraded to El Capitan on my Mac. Since then, I have received
> error messages regarding 64-bit issues. I've tried to reinstall simple ITK
> multiple times using the python binaries as stated here
> https://itk.org/Wiki/SimpleITK/GettingStarted#Python_binary_files with both
> pip and easy_install. However, I continue to run into issues running
> simpleITK. 
> 
> I am on OSX El Capitan (10.11) and Python 2.7. 
> 
> Here is the output when I try to install the latest via pip and and use it: 
> 
> ➜  Downloads sudo pip install  --trusted-host www.simpleitk.org -f
> http://www.simpleitk.org/SimpleITK/resources/software.html --timeout 30
> SimpleITK
> The directory '/Users/neil/Library/Caches/pip/http' or its parent directory
> is not owned by the current user and the cache has been disabled. Please
> check the permissions and owner of that directory. If executing pip with
> sudo, you may want sudo's -H flag.
> The directory '/Users/neil/Library/Caches/pip' or its parent directory is
> not owned by the current user and caching wheels has been disabled. check
> the permissions and owner of that directory. If executing pip with sudo, you
> may want sudo's -H flag.
> Collecting SimpleITK
>  Downloading
> https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.9.1/Python/SimpleITK-0.9.1-cp27-none-macosx_10_6_intel.whl
> (72.6MB)
>    100% |████████████████████████████████| 72.6MB 41.9MB/s 
> Installing collected packages: SimpleITK
> Successfully installed SimpleITK-0.9.1
> ➜  Downloads python
> Python 2.7.10 (default, Oct 23 2015, 19:19:21) 
> [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import SimpleITK as sitk
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "/Library/Python/2.7/site-packages/SimpleITK/__init__.py", line 1, in
> <module>
>    from .SimpleITK import *
>  File "/Library/Python/2.7/site-packages/SimpleITK/SimpleITK.py", line 28,
> in <module>
>    _SimpleITK = swig_import_helper()
>  File "/Library/Python/2.7/site-packages/SimpleITK/SimpleITK.py", line 24,
> in swig_import_helper
>    _mod = imp.load_module('_SimpleITK', fp, pathname, description)
> ImportError: /Library/Frameworks/Python.framework/Versions/2.7/Python: no
> appropriate 64-bit architecture (see "man python" for running in 32-bit
> mode)
>>>> 
> 
> I also tried to download a separate binary which I thought would be more
> applicable for El Capitan (Mac OSX v10.11): 
> 
> SimpleITK-0.9.0-cp27-none-macosx_10_6_intel.macosx_10_7_intel.macosx_10_8_intel.macosx_10_9_intel.macosx_10_10_intel.whl 
> 
> However, I received the same error message: 
> 
> ➜  Downloads sudo pip install
> SimpleITK-0.9.0-cp27-none-macosx_10_6_intel.macosx_10_7_intel.macosx_10_8_intel.macosx_10_9_intel.macosx_10_10_intel.whl
> The directory '/Users/neil/Library/Caches/pip/http' or its parent directory
> is not owned by the current user and the cache has been disabled. Please
> check the permissions and owner of that directory. If executing pip with
> sudo, you may want sudo's -H flag.
> The directory '/Users/neil/Library/Caches/pip' or its parent directory is
> not owned by the current user and caching wheels has been disabled. check
> the permissions and owner of that directory. If executing pip with sudo, you
> may want sudo's -H flag.
> Processing
> ./SimpleITK-0.9.0-cp27-none-macosx_10_6_intel.macosx_10_7_intel.macosx_10_8_intel.macosx_10_9_intel.macosx_10_10_intel.whl
> Installing collected packages: SimpleITK
> Successfully installed SimpleITK-0.9.0
> ➜  Downloads python
> Python 2.7.10 (default, Oct 23 2015, 19:19:21) 
> [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import SimpleITK as sitk
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "/Library/Python/2.7/site-packages/SimpleITK/__init__.py", line 1, in
> <module>
>    from .SimpleITK import *
>  File "/Library/Python/2.7/site-packages/SimpleITK/SimpleITK.py", line 28,
> in <module>
>    _SimpleITK = swig_import_helper()
>  File "/Library/Python/2.7/site-packages/SimpleITK/SimpleITK.py", line 24,
> in swig_import_helper
>    _mod = imp.load_module('_SimpleITK', fp, pathname, description)
> ImportError: /Library/Frameworks/Python.framework/Versions/2.7/Python: no
> appropriate 64-bit architecture (see "man python" for running in 32-bit
> mode)
>>>> 
> 
> Any help to get simpleITK in python working again would be appreciated.
> Thanks in advance! 
> 
> Neil 
> 
> 
> 
> --
> View this message in context: http://itk-users.7.n7.nabble.com/Simple-ITK-Python-not-working-on-Mac-El-Capitan-10-11-tp37265p37268.html
> Sent from the ITK - Users mailing list archive at Nabble.com.
> _____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users



More information about the Insight-users mailing list