Open GoogleCodeExporter opened 9 years ago
+1 from me. Swig does support python 3, so it should be very easy to to build a
btk for python 3.
http://www.swig.org/Doc3.0/SWIGDocumentation.html#Python_python3support
Original comment by mel...@gmail.com
on 17 Sep 2014 at 6:44
Hi,
it is very easy indeed. I just compiled python 3 compatible bindings for linux
by simply adding the string -py3 to the swig flags variable in the swig config
file. I tried to compile it for windows but finally gave up because I had no 64
bit compiler. In sum, if the build environment is properly configured to
produce python 2 bindings, producing python 3 binding is straightforward.
Original comment by yosoymic...@gmail.com
on 17 Sep 2014 at 7:55
Hi again,
just to clarify, because it took some minutes to remember what I did once I
have to repeat the process. It is a bit hackish, but for the time being it
generates a fully functional (as far as I can tell) python 3 wrapper for b-tk.
Modify the file b-tk.core/Wrapping/Python/CMakeLists.txt
In line 23 it says:
SET(CMAKE_SWIG_FLAGS "")
and should read
SET(CMAKE_SWIG_FLAGS "-py3")
That's it! If anyone can compile it for windows32/64, please share the library
or the specific method, because I haven't been able after a couple of hours of
frustation.
Best,
Jorge
Original comment by yosoymic...@gmail.com
on 15 Dec 2014 at 4:10
Hi,
I just noticed that the method I posted only generates functional python
extensions for 32 bit versions. I haven't been able to determine the problem
for 64 bit linux compilations, and for the time being I will give up on this
because I use it mostly in a 32 bit distribution.
Original comment by yosoymic...@gmail.com
on 7 Feb 2015 at 11:08
Hi,
based on your comments, I manage to port generate python 3.4 bindings.
My os is a linux mint 17, 64 bit
Build and install cmake 3.1.3 with --qt-gui option (from here i can use python3
compiler)
Modify the file b-tk.core/Wrapping/Python/CMakeLists.txt as you already
mentionned.
Use cmake gui and build btk without bindings.
install btk with sudo make install in the terminal
Back to cmake-gui and enable binding.
configure give error finfing numpy, just add an entry NUMPY_VERSION and another
named NUMPY_INCLUDE_DIR (pointing at
/usr/lib/python3/dist_packages/numpy/core/include)
configure and build
and install again.
Finally, i don't know why but python files are not moved to the good place. I
made it manually copying all the files in bin directory to
/usr/local/lib/python3.4/dist-packages/btk. I also need to rename btk.py to
__init__.py
With this method I manage to use btk in python3.4 idle and in blender python.
Original comment by marin_a...@yahoo.fr
on 12 Mar 2015 at 4:12
Original issue reported on code.google.com by
yosoymic...@gmail.com
on 1 Jul 2014 at 7:57