[Insight-users] SimpleITK Installation

Bradley Lowekamp blowekamp at mail.nih.gov
Wed Nov 2 14:19:10 EDT 2011


Hello Nick,


On Nov 2, 2011, at 1:13 PM, Nick Rubert wrote:

> Hi Matt,
> 
> Thanks for the advice.   However, when I run setup.py with:
> python SimpleITK-build/Wrapping/PythonPackage/setup.py install

This "python" must be the target version of python where you want the package installed.

I have usually have done the following to install from the build directory:

easy_install SimpleITK-build/Wrapping/SimpleITK-0.3.0-py2.6.egg

> 
>  while in the build directory I get a shared library _SimpleITK.so written to my dist_packages folder, and I am able to import _SimpleITK when I launch ipython.
> However, I am still not able to import SimpleITK.  I get a module not found error if I try import SimpleITK.

This is the contents of my dist-packages/site-packages folder after I installed SimpleITK:

$ ls -a /Library/Frameworks/Python.framework/Versions/7.1/lib/python2.7/site-packages/SimpleITK-0.3.0-py2.7.egg/
.             ..            EGG-INFO      SimpleITK.py  SimpleITK.pyc _SimpleITK.so

So you should not have a SimpleITK.so, but you should also have a SimpleITK.py file. The location of that file in the build directory is:

/SimpleITK-build/Wrapping/SimpleITK.py.



> 
> If I then run easy_install SimpleITK while in the build directory it believes SimpleITK is installed,and it gives me the following message:
> Searching for SimpleITK
> Best match: SimpleITK 0.3.0
> Processing SimpleITK-0.3.0-py2.7.egg
> SimpleITK 0.3.0 is already the active version in easy-install.pth
> 
> Using /usr/local/lib/python2.7/dist-packages/SimpleITK-0.3.0-py2.7.egg
> Processing dependencies for SimpleITK
> Finished processing dependencies for SimpleITK
> 

It appears that easy_install got confused with the version already install. The command "easy_install SimpleITK" usually does not look at the build directory. It looks at pypi.python.org for an appropriate version to download and install. There should be a binary version available for your system.

You should uninstall the already installed SimpleITK before running  "easy_install SimpleITK"

To uninstall the python egg, recusively remove the "SimpleITK-0.3.0-py2.7.egg" directory from your dist_packages folder and removed the matching line from site-packages/easy-install.pth. Then try the "easy_install SimpleITK".

> 
> Did I miss a step in the installation?  Should there be a SimpleITK.so in my dist_packages in addition to _SimpleITK.so?

No SimpleITK.so, you appear to be missing a SimpleITK.py.

> 
> Nick

Brad

> 
> On Wed, Nov 2, 2011 at 11:44 AM, Matt McCormick <matt.mccormick at kitware.com> wrote:
> Hey Nick,
> 
> Try
> 
> 
> 
> Otherwise, binaries are available, so you could have just done
> 
>  easy_install SimpleITK
> 
> and it should grab the binary from the web and install it without
> building anything.
> 
> Ciao,
> Matt
> 
> On Wed, Nov 2, 2011 at 12:36 PM, Nick Rubert <ncrubert at gmail.com> wrote:
> > Hi listserve,
> >
> > I am running Ubuntu 11.10, and I am trying to install SimpleITK for use in
> > python 2.7.  I've downloaded the source off of github.
> >
> > I run ccmake in the SuperBuild directory and turn off all wrapping except
> > for python.
> > If I run make then all is compiled without errors.
> > However, when I try to run make install I get an error.  I am told there is
> > no rule for install.
> > Also, if I try to import SimpleITK into Python I get a module not found
> > error.
> >
> > Are there any special steps for installing SimpleITK?
> >
> > NIck Rubert
> >
> > _____________________________________
> > 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.html
> >
> > 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://www.itk.org/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.html
> 
> 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://www.itk.org/mailman/listinfo/insight-users

========================================================
Bradley Lowekamp  
Medical Science and Computing for
Office of High Performance Computing and Communications
National Library of Medicine 
blowekamp at mail.nih.gov



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20111102/75e73696/attachment.htm>


More information about the Insight-users mailing list