[ITK] Fwd: ITK and python wrap problem

Michka Popoff michkapopoff at gmail.com
Sat Aug 23 10:16:07 EDT 2014


Yes your initial problem was the ldconfig one.
I’m glad it works for you now.

Yes please if you have some notes on the protocol for Ubuntu, just send it to the list
so that I can update it on the wiki.

Michka

On 23 août 2014, at 16:08, gowith king <gowithking at googlemail.com> wrote:

> That means the mismatching is not really matter and the essential problem is the valence of idconfig activation.
>  So I will write a summary to end our discussion to emailling list and recommend your wrapping protocol, which should also work on Ubuntu.
> have a nice weekend. 
>  
> 
> 
> On Sat, Aug 23, 2014 at 3:41 PM, gowith king <gowithking at googlemail.com> wrote:
> update :
> following Mr. Popoff 's instruction, I add these few command to active ldconfig
> cd /etc/ld.so.conf.d/
> add a file called itk-46.conf, which should contain only one line: /usr/local/lib
> ldconfig # tells the system to read the files in ld.so.conf.d
> then python 
> import itk
> itk.image 
> lots warning reported :
> Warning: Unknown parameter 'itk::Matrix< float, 2, 2 >' in template 'itk::VectorContainer'
> Warning: Unknown parameter 'itk::Matrix< double, 2, 2 >' in template 'itk::VectorContainer'
> Warning: Unknown parameter 'itk::Matrix< float, 3, 3 >' in template 'itk::VectorContainer'
> Warning: Unknown parameter 'itk::Matrix< double, 3, 3 >' in template 'itk::VectorContainer'
> Warning: Unknown parameter 'itk::DefaultStaticMeshTraits< float,2,2,float,float >' in template 'itk::PointSet'
> Warning: Unknown parameter 'itk::DefaultDynamicMeshTraits< float,2,2,float,float >' in template 'itk::PointSet'
> Warning: Unknown parameter 'itk::DefaultStaticMeshTraits< float,3,3,float,float >' in template 'itk::PointSet'
> Warning: Unknown parameter 'itk::DefaultDynamicMeshTraits< float,3,3,float,float >' in template 'itk::PointSet'
> Warning: Unknown parameter 'itk::DefaultStaticMeshTraits< double,2,2,double,double,double >' in template 'itk::PointSet'
> Warning: Unknown parameter 'itk::DefaultStaticMeshTraits< double,3,3,double,double,double >' in template 'itk::PointSet'
> Warning: Unknown parameter 'itk::DefaultStaticMeshTraits< itk::Matrix <double,2,2>,2,2,float,float,itk::Matrix <double,2,2> >' in template 'itk::PointSet'
> Warning: Unknown parameter 'itk::DefaultStaticMeshTraits< itk::Matrix <double,3,3>,3,3,float,float,itk::Matrix <double,3,3> >' in template 'itk::PointSet'
> Warning: Unknown parameter 'itk::DefaultStaticMeshTraits< float,2,2,float,float >' in template 'itk::Mesh'
> Warning: Unknown parameter 'itk::DefaultDynamicMeshTraits< float,2,2,float,float >' in template 'itk::Mesh'
> Warning: Unknown parameter 'itk::DefaultStaticMeshTraits< float,3,3,float,float >' in template 'itk::Mesh'
> Warning: Unknown parameter 'itk::DefaultDynamicMeshTraits< float,3,3,float,float >' in template 'itk::Mesh'
> Warning: Unknown parameter 'itk::CellInterface< float, itk::CellTraitsInfo< 2,float,float,unsigned long,unsigned long,unsigned long,itk::Point< float,2 >,itk::MapContainer< unsigned long,itk::Point< float,2 > >, std::set< unsigned long, std::less< unsigned long > > > > *' in template 'itk::MapContainer'
> Warning: Unknown parameter 'itk::CellInterface< double, itk::CellTraitsInfo< 2,double,double,unsigned long,unsigned long,unsigned long,itk::Point< double,2 >,itk::MapContainer< unsigned long,itk::Point< double,2 > >, std::set< unsigned long, std::less< unsigned long > > > > *' in template 'itk::MapContainer'
> Warning: Unknown parameter 'itk::CellInterface< float, itk::CellTraitsInfo< 3,float,float,unsigned long,unsigned long,unsigned long,itk::Point< float,3 >,itk::MapContainer< unsigned long,itk::Point< float,3 > >, std::set< unsigned long, std::less< unsigned long > > > > *' in template 'itk::MapContainer'
> Warning: Unknown parameter 'itk::CellInterface< double, itk::CellTraitsInfo< 3,double,double,unsigned long,unsigned long,unsigned long,itk::Point< double,3 >,itk::MapContainer< unsigned long,itk::Point< double,3 > >, std::set< unsigned long, std::less< unsigned long > > > > *' in template 'itk::MapContainer'
> Warning: Unknown parameter 'itk::CellInterface< float, itk::CellTraitsInfo< 2,float,float,unsigned long,unsigned long,unsigned long,itk::Point< float,2 >,itk::MapContainer< unsigned long,itk::Point< float,2 > >, std::set< unsigned long, std::less< unsigned long > > > > *' in template 'itk::VectorContainer'
> Warning: Unknown parameter 'itk::CellInterface< double, itk::CellTraitsInfo< 2,double,double,unsigned long,unsigned long,unsigned long,itk::Point< double,2 >,itk::MapContainer< unsigned long,itk::Point< double,2 > >, std::set< unsigned long, std::less< unsigned long > > > > *' in template 'itk::VectorContainer'
> Warning: Unknown parameter 'itk::CellInterface< float, itk::CellTraitsInfo< 3,float,float,unsigned long,unsigned long,unsigned long,itk::Point< float,3 >,itk::MapContainer< unsigned long,itk::Point< float,3 > >, std::set< unsigned long, std::less< unsigned long > > > > *' in template 'itk::VectorContainer'
> Warning: Unknown parameter 'itk::CellInterface< double, itk::CellTraitsInfo< 3,double,double,unsigned long,unsigned long,unsigned long,itk::Point< double,3 >,itk::MapContainer< unsigned long,itk::Point< double,3 > >, std::set< unsigned long, std::less< unsigned long > > > > *' in template 'itk::VectorContainer'
> Warning: Unknown parameter 'itk::CellTraitsInfo< 2,float,float,unsigned long,unsigned long,unsigned long,itk::Point< float,2 >,itk::MapContainer< unsigned long,itk::Point< float,2 > >, std::set< unsigned long, std::less< unsigned long > > >' in template 'itk::CellInterfaceVisitor'
> Warning: Unknown parameter 'itk::CellTraitsInfo< 2,double,double,unsigned long,unsigned long,unsigned long,itk::Point< double,2 >,itk::MapContainer< unsigned long,itk::Point< double,2 > >, std::set< unsigned long, std::less< unsigned long > > >' in template 'itk::CellInterfaceVisitor'
> Warning: Unknown parameter 'itk::CellTraitsInfo< 3,float,float,unsigned long,unsigned long,unsigned long,itk::Point< float,3 >,itk::MapContainer< unsigned long,itk::Point< float,3 > >, std::set< unsigned long, std::less< unsigned long > > >' in template 'itk::CellInterfaceVisitor'
> Warning: Unknown parameter 'itk::CellTraitsInfo< 3,double,double,unsigned long,unsigned long,unsigned long,itk::Point< double,3 >,itk::MapContainer< unsigned long,itk::Point< double,3 > >, std::set< unsigned long, std::less< unsigned long > > >' in template 'itk::CellInterfaceVisitor'
> Warning: Unknown parameter 'itk::CellTraitsInfo< 2,float,float,unsigned long,unsigned long,unsigned long,itk::Point< float,2 >,itk::MapContainer< unsigned long,itk::Point< float,2 > >, std::set< unsigned long, std::less< unsigned long > > >' in template 'itk::CellInterface'
> Warning: Unknown parameter 'itk::CellTraitsInfo< 2,double,double,unsigned long,unsigned long,unsigned long,itk::Point< double,2 >,itk::MapContainer< unsigned long,itk::Point< double,2 > >, std::set< unsigned long, std::less< unsigned long > > >' in template 'itk::CellInterface'
> Warning: Unknown parameter 'itk::CellTraitsInfo< 3,float,float,unsigned long,unsigned long,unsigned long,itk::Point< float,3 >,itk::MapContainer< unsigned long,itk::Point< float,3 > >, std::set< unsigned long, std::less< unsigned long > > >' in template 'itk::CellInterface'
> Warning: Unknown parameter 'itk::CellTraitsInfo< 3,double,double,unsigned long,unsigned long,unsigned long,itk::Point< double,3 >,itk::MapContainer< unsigned long,itk::Point< double,3 > >, std::set< unsigned long, std::less< unsigned long > > >' in template 'itk::CellInterface'
> Warning: Unknown parameter 'itk::Mesh< float,2,itk::DefaultStaticMeshTraits< float,2,2,float > >' in template 'itk::MeshToMeshFilter'
> Warning: Unknown parameter 'itk::Mesh< float,2,itk::DefaultDynamicMeshTraits< float,2,2,float > >' in template 'itk::MeshToMeshFilter'
> Warning: Unknown parameter 'itk::Mesh< float,3,itk::DefaultStaticMeshTraits< float,3,3,float > >' in template 'itk::MeshToMeshFilter'
> Warning: Unknown parameter 'itk::Mesh< float,3,itk::DefaultDynamicMeshTraits< float,3,3,float > >' in template 'itk::MeshToMeshFilter'
> 
> 
> 
> 
> On Fri, Aug 22, 2014 at 6:13 PM, gowith king <gowithking at googlemail.com> wrote:
> I recorded my procedure as follow:
> cd ~
> git clone git://itk.org/ITK.git
> cd ITK
> git pull
> mkdir BUILD
> cd BUILD
> ccmake ..
> in the ccmake configure options the follow flags were selected:
> BUILD_EXAMPLES                   OFF                                          
>  BUILD_SHARED_LIBS                ON                                           
>  BUILD_TESTING                    OFF                                          
>  CMAKE_BUILD_TYPE                 Release 
> ITK_WRAP_PERL                    OFF                                          
>  ITK_WRAP_PYTHON                  ON  
> PERL_EXECUTABLE                  /usr/bin/perl                                
>  PYTHON_EXECUTABLE                /usr/bin/python                              
>  PYTHON_INCLUDE_DIR               /usr/include/python2.7                       
>  PYTHON_LIBRARY                   /usr/lib/libpython2.7.so                     
>  PY_SITE_PACKAGES_PATH            /usr/lib/python2.7/dist-packages             
>  SCPCOMMAND                       /usr/bin/scp 
> 
> Then the configure warning of executable and library mismatch comes, ignore the warning 
> g to generation 
> sudo make 
> sudo make install 
> 
> for the test :
> python 
> >>>import itk 
> >>> inputimage=itk.Image[itk.UC,3] --- errors report here : 
> in eclispe : undefined variable from import UC 
> in terminal :Traceback (most recent call last):
> 
>   File "<stdin>", line 1, in <module>
>   File "/usr/local/lib/ITK-4.7/Python/itkLazy.py", line 42, in __getattribute__
>     itkBase.LoadModule(module, namespace)
>   File "/usr/local/lib/ITK-4.7/Python/itkBase.py", line 108, in LoadModule
>     LoadModule(dep, namespace)
>   File "/usr/local/lib/ITK-4.7/Python/itkBase.py", line 108, in LoadModule
>     LoadModule(dep, namespace)
>   File "/usr/local/lib/ITK-4.7/Python/itkBase.py", line 108, in LoadModule
>     LoadModule(dep, namespace)
>   File "/usr/local/lib/ITK-4.7/Python/itkBase.py", line 108, in LoadModule
>     LoadModule(dep, namespace)
>   File "/usr/local/lib/ITK-4.7/Python/itkBase.py", line 118, in LoadModule
>     module = loader.load(swigModuleName)
>   File "/usr/local/lib/ITK-4.7/Python/itkBase.py", line 224, in load
>     return imp.load_module(name, fp, pathname, description)
>   File "/usr/local/lib/ITK-4.7/Python/ITKCommonPython.py", line 32, in <module>
>     _ITKCommonPython = swig_import_helper()
>   File "/usr/local/lib/ITK-4.7/Python/ITKCommonPython.py", line 28, in swig_import_helper
>     _mod = imp.load_module('_ITKCommonPython', fp, pathname, description)
> ImportError: libitkvnl_algo-4.7.so.1: cannot open shared object file: No such file or directory
> 
> 
> 
> 
> 
> 
> On Fri, Aug 22, 2014 at 5:55 PM, gowith king <gowithking at googlemail.com> wrote:
> Please keep the discussion on the mailing list :)
> 
> This is my first post in mailing list system " if this is a sort of system, :)" 
> I guess that means I should always do not forget to cc to community? or what else should I do to keep it?
> 
> 
> Okay, so you will have to find the paths to the right folders/files to be consistent in your python choice.
> 
> 
> I have no idea Howto identify the python2.7.3 working library, normally they are lots of .pyr files in the folder of  /usr/lib/python2.7 . I find a similar .so file  in /usr/lib/libpython2.7.so . 
> However in your instruction :PYTHON_LIBRARY = /usr/lib64/libpython2.7.so.1.0
> The file "libpython2.7.so.1.0" also present in the same path : /usr/lib/libpython2.7.so.1.0 ; should I use this file?
> 
> I would be happy if you could communicate me the paths for Ubuntu 12.04, so I could extend the installation procedure.
> 
> How could I send you the path of ubuntu 12.04? I can try to switch on a remote assistant if necessary. 
> 
> 
> Seems on ubuntu the procedure is the same for loading the shared libraries:
> http://unix.stackexchange.com/questions/67781/use-shared-libraries-in-usr-local-lib
> On Ubuntu you should have a /etc/ld.so.conf file. Then you should run ldconfig.
> 
> 
> On Fri, Aug 22, 2014 at 5:30 PM, Michka Popoff <michkapopoff at gmail.com> wrote:
> Please keep the discussion on the mailing list :)
> 
> Okay, so you will have to find the paths to the right folders/files to be consistent in your python choice.
> I would be happy if you could communicate me the paths for Ubuntu 12.04, so I could extend the installation procedure.
> 
> Seems on ubuntu the procedure is the same for loading the shared libraries:
> http://unix.stackexchange.com/questions/67781/use-shared-libraries-in-usr-local-lib
> On Ubuntu you should have a /etc/ld.so.conf file. Then you should run ldconfig.
> 
> Michka
> 
> On 22 août 2014, at 17:21, gowith king <gowithking at googlemail.com> wrote:
> 
>> Dear Popoff 
>>      I am using Ubuntu 12.04 LTS. the warning is the mismatching of python library and python executable : python executable "2.7.3" and library "" is mismatched. Here is the option setting:
>> 
>> 
>> PYTHON_EXECUTABLE                /usr/bin/python                              
>>  PYTHON_INCLUDE_DIR               /usr/include/python2.7                       
>>  PYTHON_LIBRARY                   /usr/lib/libpython2.7.so                     
>>  PY_SITE_PACKAGES_PATH            /usr/lib/python2.7/dist-packages          
>> 
>> The libitkvnl_algo-4.7.so file exist in /usr/local/lib . 
>> 
>> I do have few python versions been installed in the same OS. 
>> The flags in the instruction of  'http://www.itk.org/Wiki/ITK_Release_4/Wrapping/WrapITK_Installation' are not exact as the same as the description. I will try your instruction step be step in my system. 
>> By the way, your instruction is so practical.
>> 
>> Have a nice day. 
>> 
>>   
>> 
>> 
>> 
>> On Fri, Aug 22, 2014 at 4:15 PM, Michka Popoff <michkapopoff at gmail.com> wrote:
>> Hi
>> 
>> Some important questions first:
>> 
>> What was the warning for the library mismatch ?
>> On what OS are you installing ?
>> Is the libitkvnl_algo-4.7.so file present in /usr/local/lib ?
>> 
>> If the warnings were about the python library, it is quite important.
>> It may happen that you have two different python installations, and cmake is not able to find the right libraries.
>> 
>> I wrote some instructions to install ITK with python wrapping on Fedora http://www.itk.org/Wiki/ITK/WrapITKInstallFedora
>> There is a list of cmake flags you can set to help cmake find the right python, if it’s the problem you had.
>> I think the error is just because the library is not in your path. If you are using Fedora, just follow the instructions I wrote down.
>> For other OS’es there are ways to do this, like setting the LD_LIBRARY_PATH for example (you'll have to google this)
>> 
>> Feedback is welcome so I can improve the installation instructions :)
>> 
>> Michka
>> 
>> On 22 août 2014, at 16:06, gowith king <gowithking at googlemail.com> wrote:
>> 
>>> 
>>> 
>>> ---------- Forwarded message ----------
>>> From: gowith king <gowithking at googlemail.com>
>>> Date: Fri, Aug 22, 2014 at 1:32 PM
>>> Subject: ITK and python wrap problem
>>> To: community at itk.org
>>> 
>>> 
>>> Dear ITK friends
>>>       I am not sure this is an appropriate place to issue my problem in the wrapping  process:
>>>       I followed the instruction of 'http://www.itk.org/Wiki/ITK_Release_4/Wrapping/WrapITK_Installation' to finish the compiling and installing process. it look good so far except a warning of mismatching library version, I think it could be ignored. 
>>>       Then I tried one line for test :
>>> >>> import itk 
>>> >>> inputimage=itk.Image[itk.UC,3]
>>> Traceback (most recent call last):
>>>   File "<stdin>", line 1, in <module>
>>>   File "/usr/local/lib/ITK-4.7/Python/itkLazy.py", line 42, in __getattribute__
>>>     itkBase.LoadModule(module, namespace)
>>>   File "/usr/local/lib/ITK-4.7/Python/itkBase.py", line 108, in LoadModule
>>>     LoadModule(dep, namespace)
>>>   File "/usr/local/lib/ITK-4.7/Python/itkBase.py", line 108, in LoadModule
>>>     LoadModule(dep, namespace)
>>>   File "/usr/local/lib/ITK-4.7/Python/itkBase.py", line 108, in LoadModule
>>>     LoadModule(dep, namespace)
>>>   File "/usr/local/lib/ITK-4.7/Python/itkBase.py", line 108, in LoadModule
>>>     LoadModule(dep, namespace)
>>>   File "/usr/local/lib/ITK-4.7/Python/itkBase.py", line 118, in LoadModule
>>>     module = loader.load(swigModuleName)
>>>   File "/usr/local/lib/ITK-4.7/Python/itkBase.py", line 224, in load
>>>     return imp.load_module(name, fp, pathname, description)
>>>   File "/usr/local/lib/ITK-4.7/Python/ITKCommonPython.py", line 32, in <module>
>>>     _ITKCommonPython = swig_import_helper()
>>>   File "/usr/local/lib/ITK-4.7/Python/ITKCommonPython.py", line 28, in swig_import_helper
>>>     _mod = imp.load_module('_ITKCommonPython', fp, pathname, description)
>>> ImportError: libitkvnl_algo-4.7.so.1: cannot open shared object file: No such file or directory
>>> 
>>> I got totally lost for this, what should I do to fix this?
>>> Any suggestion would be appreciated
>>> 
>>>        
>>>     
>>> 
>>> _______________________________________________
>>> 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/20140823/8663a205/attachment-0002.html>


More information about the Community mailing list