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

Bradley Lowekamp blowekamp at mail.nih.gov
Tue Jul 14 08:12:47 EDT 2015


Hello,

Can you run "otool -L /path/to/_SimpleITK.so" and "otool -L /Shared/pinc/sharedopt/20150704/DARWIN/anaconda_20150704/anaconda/lib/libpython2.7.so". This may give some information about the expected runtime dependency, and what is preventing the library from loading.

If you are building for conda, you may want to look into using the conda-recipe for SimpleITK [1].

HTH,
Brad

[1] https://github.com/blowekamp/conda-recipes/tree/SimpleITKUpdate0.9.0/simpleitk

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

> We did not build shared libraries for ITK and our CMAKE_ARCHIVE_OUTPUT_DIRECTORY=${NAMICExtBuild}/lib, which is already on my DYLD_LIBRARY_PATH (this is set via postactivate in the virtualenv).  
> 
> We use the RPATH, but there are no additional paths via DYLD_LIBRARY_PATH at compile time, AFAIK. 
> 
> With some more investigation, this build was compiled inside an Anaconda environment so I'll see if I can tease out the issue.  In the meanwhile, here's the SimpleITK CMakeCache file.
> 
> Cheers,
> Dave
> 
> On Mon, Jul 13, 2015 at 2:38 PM, Bradley Lowekamp <blowekamp at mail.nih.gov> wrote:
> 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
> 
> 
> <CMakeCache.txt>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20150714/97400a8d/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