Problem Installing Python Wrapper

118 views
Skip to first unread message

Eric Walker

unread,
Sep 18, 2012, 12:32:00 PM9/18/12
to btk-...@googlegroups.com
I was wondering if anyone has had success building and installing the btk python wrapper on osx?  I have been able to successfully compile and use the Matlab wrapper from the source, but have not had luck with the python wrapper.  There are no errors when building or installing the python wrapper, but when trying to import the module python cannot find the btk module.  I think I have isolated the problem to an issue with linking the swig output into a python module, since the swig outputs (_btk.so, btk.py, libBTKBasicFilters.a, libBTKCommon.a, and libBTKIO.a) are generated in a bin folder in the build directory.  Is there an additional step that I am missing after "make install"?  I included my CMakeCahce and install manifest to see if there was a CMake setting I missed. 

System Settings:
OS X: 10.6.8
Python: 2.7.3, installed using hombrew, CMake Flags updated to use this version
Swig: 2.0.8
CMake: 2.8.9

Thanks for the help 
Eric


CMakeCache.txt
install_manifest.txt

Arnaud BARRE

unread,
Sep 18, 2012, 4:03:22 PM9/18/12
to btk-...@googlegroups.com
Hi Eric,

At this moment, there is no installation step for the Python package. I'm looking to the new way proposed by Python (PIP: http://pypi.python.org/pypi/pip).

The simplest way right now is to add the path of BTK manually in Python. You can do it using the following code:
# Python code
import sys
sys.path.append('btk_build_dir/bin')
# You can then import BTK as a standard package.
import btk

The documentation is still limited as only the classes are documented. A contributor (Fabien Leboeuf) sent me a nice tutorial for the use of BTK in Python. I have to translate it in Doxygen, but it will be included in BTK 0.2. You can look into the folder Testing/Python, you will find lots of examples.

Let me know, if you need more informations.

Arnaud

Eric


--
You received this message because you are subscribed to the Google Groups "BTK Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/btk-users/-/w29BmHkp2VIJ.
To post to this group, send email to btk-...@googlegroups.com.
To unsubscribe from this group, send email to btk-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/btk-users?hl=en.

Reply all
Reply to author
Forward
0 new messages