Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python3 support #2

Open
jjnurminen opened this issue Nov 13, 2018 · 9 comments
Open

Python3 support #2

jjnurminen opened this issue Nov 13, 2018 · 9 comments

Comments

@jjnurminen
Copy link

jjnurminen commented Nov 13, 2018

Hi,

I have written a library for processing and visualization of 3d gait data that heavily relies on btk Python bindings. I'm planning a transition to Python 3, since major libraries like NumPy are planning to drop Python 2 support soon.

Are there plans to make the btk bindings Python 3 compatible? Would this entail a lot of work?

@Alzathar @aaa34169

@CameronJGrant
Copy link

I had the same issue. I ended up rebuilding the package from the source code using the Python 3 libraries. It worked like a charm.

For reference I used:
Windows 10
cmake: 3.15.1
Python: 3.5.3
SWIG: 4.0.0
NumPy: 1.17.0

Since the BTK package relies completely on C++ code, you should be able to easily rebuild the package in any language that is supported by SWIG, including the latest versions of Python.

Just follow the instructions here:
https://biomechanical-toolkit.github.io/docs/API/_build_instructions.html

@jjnurminen
Copy link
Author

@CameronJGrant thanks!
There are also rumours about a new PyBTK package on PyPi which supports Python 3.

@aaa34169
Copy link

aaa34169 commented Aug 22, 2019 via email

@jjnurminen
Copy link
Author

Sorry for the advertisement Fabien ;)

@henrypowell87
Copy link

Hi @CameronJGrant. I'm currently trying to get BTKPython running. I have installed BTKCore-Master using cmake and have downloaded the BTKPython-Master repo. I'm not sure where to go from here, though. If I add the bin/ directory to my path using sys in Python (as has been suggested here: http://biomechanical-toolkit.github.io/docs/Wrapping/Python/_getting_started.html) it doesn't find any of the necessary python files. Am I in the right direction here or have I already gone wrong? The link you posted to instructions 404ed for me. Any help would be greatly appreciated. Cheers.

@CameronJGrant
Copy link

@henrypowell87
Hi Henry,
Actually, @melund has done some great work creating a Python 3 conda package for btk:
Biomechanical-ToolKit/BTKCore#28

It can be installed through:
conda install -c conda-forge btk

Will that work for you, or do you need to compile things yourself?

@henrypowell87
Copy link

@CameronJGrant Thanks for this! After pulling my hair out all day trying to get things working with cmake and the BTK repos I've resorted to a conda install on my work OSX of the ezc3d package (linked here: https://github.com/pyomeca/ezc3d) which I'm currently testing. I'll take a look at the conda btk library you linked as well. Great to hear someone has been working to streamline the btk set up with python (wish I found that 6 hours ago, though!).

Many thanks for getting back so quickly! Cheers.

@melund
Copy link

melund commented Jan 22, 2020

@henrypowell87 I would also suggest that you use ezc3d. It is not as stable as btk, but is actively maintained and it has more pythonic interface.

Also, the btk conda package I made is only for windows. Because that is what I have available, and what I needed.

It can be converted to mac. Probably quite easily. If you have struggled with cmake, then maybe you are the right person to enable mac/linux support for the conda package. See this PR which I have started:

conda-forge/btk-feedstock#4

But again, consider something else if you are starting a new project. The conda package was mostly for supporting my old projects. Now that python2 is dead.

@henrypowell87
Copy link

@melund Thanks for this response. I did indeed find ezc3d pretty straight forward to use and, for the time being at least, it's doing the pretty basic job I needed it for. If I run into issues with the stability of the library in the future I'll be sure to looking into working on porting the btk conda package to linux/ OSX. Thanks again for getting back to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants