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

paniwani paniwani at gmail.com
Fri Jun 17 16:11:49 EDT 2016


I eventually got it working by re-installing python as above and then using
homebrew to install simple itk. Thanks for your help!

Neil

On Fri, Jun 17, 2016 at 1:03 PM, Neil Panjwani <paniwani at gmail.com> wrote:

> I had several versions of Python installed. I removed the version at
> /Library/Frameworks and reinstalled Python 2.7 using Homebrew. I then
> followed the advice of the guide and setup a virtual environment within my
> project (called ecvenv), installed pip, upgraded pip, and used it to
> install SimpleITK. It installed the one you recommended earlier, v0.9.1.
>
> (ecvenv) *➜  **econtour* *git:(**master**) **✗* pip install
> --trusted-host www.simpleitk.org -f
> http://www.simpleitk.org/SimpleITK/resources/software.html --timeout 30
> SimpleITK
>
> 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 43.5MB/s
>
> Installing collected packages: SimpleITK
>
> Successfully installed SimpleITK-0.9.1
>
>
> However, I continue to run into a "Fatal Python Error" when trying to load
> simple itk from within python. See below:
>
> (ecvenv) *➜  **econtour* *git:(**master**) **✗* which python
>
> /Users/neil/work/Meteor/econtour/ecvenv/bin/python
>
> (ecvenv) *➜  **econtour* *git:(**master**) **✗* which pip
>
> /Users/neil/work/Meteor/econtour/ecvenv/bin/pip
>
> (ecvenv) *➜  **econtour* *git:(**master**) **✗* pip list
>
> pip (8.1.2)
>
> setuptools (23.0.0)
>
> SimpleITK (0.9.1)
>
> wheel (0.29.0)
>
> (ecvenv) *➜  **econtour* *git:(**master**) **✗* python
>
> Python 2.7.11 (default, Jan 22 2016, 08:29:18)
>
> [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
>
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> import SimpleITK as sitk
>
> Fatal Python error: PyThreadState_Get: no current thread
>
> [1]    2805 abort      python
>
>
>
>
> On Fri, Jun 17, 2016 at 9:56 AM, Bradley Lowekamp [via ITK - Users] <
> ml-node+s7n37269h95 at n7.nabble.com> wrote:
>
>> 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 <[hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=37269&i=0>> 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
>>
>> _____________________________________
>> 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
>>
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://itk-users.7.n7.nabble.com/Simple-ITK-Python-not-working-on-Mac-El-Capitan-10-11-tp37265p37269.html
>> To unsubscribe from Simple ITK Python not working on Mac El Capitan
>> (10.11), click here
>> <http://itk-users.7.n7.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=37265&code=cGFuaXdhbmlAZ21haWwuY29tfDM3MjY1fC0xOTE2MTYxMTkw>
>> .
>> NAML
>> <http://itk-users.7.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
>
> --
> Neil Panjwani
> Duke University | B.S.E. 2010
> Tel: (760) 486-0765
>



-- 
Neil Panjwani
Duke University | B.S.E. 2010
Tel: (760) 486-0765




--
View this message in context: http://itk-users.7.n7.nabble.com/Simple-ITK-Python-not-working-on-Mac-El-Capitan-10-11-tp37265p37271.html
Sent from the ITK - Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20160617/fa859d87/attachment.html>


More information about the Insight-users mailing list