[ITK] [ITK-users] ImportError: No module named _SimpleITK

Bradley Lowekamp blowekamp at mail.nih.gov
Mon Jul 13 15:38:27 EDT 2015


Hello David,

I am going to guess that you compiled ITK with shared libraries?

Most likely python couldn't resolve the ITK library dependencies when it tried to load _SimpleITK.so.

Try adding the ITK library directory to you LD_LIBRARY_PATH environment variable.

I am also going to guess that you are relying on CMake setting the RPATH for the libraries based on the build directory for you other projects. SimpleITK explicitly disables this [1], to enable language based packaging from the build tree without using CMake to modify the RPATH. Your case may be a reasonable option to allow the user to configure a default for SKIP_BUILD_RPATH for SimpleITK, but I am not completely sure of the expected and reasonable behavior for this. Nor if anyone else would know how to do it.

HTH,
Brad

[1] https://github.com/SimpleITK/SimpleITK/blob/master/Code/BasicFilters/src/CMakeLists.txt#L109

On Jul 13, 2015, at 2:55 PM, David Welch <david.m.welch at gmail.com> wrote:

> Hi Brad, 
> 
> I've built a virtualenv using virtualenvwrapper to use SimpleITK (built using NAMICExternalProjects).  For reproducibility, we'd like to use only dependencies within the ${NAMICExtBuild} directory, which makes most of the online installation instructions invalid, AFAIK. 
> 
> I've prepend the sys.path like so:
> 
> add2virtualenv ${NAMICExtBuild}/SimpleITK-build/bin
> add2virtualenv ${NAMICExtBuild}/SimpleITK-build/lib
> add2virtualenv ${NAMICExtBuild}/SimpleITK-build/Wrapping
> 
> This writes to the $VIRTUAL_ENV/lib/site_packages/_virtualenv_path_extensions.pth file (used by virtualenvwrapper to manage package/module paths). 
> 
> I have also tried: 
> 
> python ${NAMICExtBuild}/SimpleITK-build/Wrapping/PythonPackage/setupegg.py install
> 
> within my virtualenv, but no such luck.  Any suggestions?  
> 
> Cheers,
> Dave
> _____________________________________
> 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
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20150713/35940eff/attachment.html>
-------------- next part --------------
_____________________________________
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 Community mailing list