libmed (med file / med fichier) python3 bindings on linux

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
waebbl
Posts: 200
Joined: Thu Aug 16, 2018 3:12 pm

libmed (med file / med fichier) python3 bindings on linux

Post by waebbl »

Hello, has anyone tried to run the python bindings of libmed outside of freecad? On my gentoo box I had problems during the import of the package, i.e. import med failed with a ModuleNotFoundError exception. By replacing the import medenum statement in the various python files with from . import medenum, this issue gets 'solved'.

I figured out how to workaround this, by sed'ing the python files in the staging area of the sandbox before actually installing them to the live system. I also got a forum account on salome-platform and will ask there whether this is known, because I wasn't able to fix this due to missing swig skills. Before I report this, I want to ask, whether this issue does exist on other linux platforms too. It might even exist on other OS's too.

I am using python-3.6.5 and the libmed-3.3.1 download link from salome-platform.
For a little more input on this issue, you can also visit https://github.com/waebbl/waebbl-gentoo/issues/15

Thanks to anyone who helps investigating this.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: libmed (med file / med fichier) python3 bindings on linux

Post by Kunda1 »

I haven't nevertheless, shaking the tree again and bumping this to see if anyone else has...?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: libmed (med file / med fichier) python3 bindings on linux

Post by looo »

I remember reporting a patch to salome some time ago. But as the external smesh doesn't support libmed yet, I didn't have a look into this library anymore. for version 3.3.1 I used this patch to make the library work with python3.

Anyway I hope someone will find the time to apply changes from FreeCAD's internal smesh on the external smesh. Maybe @vejmarie.
vejmarie wrote: ping ping ping
User avatar
waebbl
Posts: 200
Joined: Thu Aug 16, 2018 3:12 pm

Re: libmed (med file / med fichier) python3 bindings on linux

Post by waebbl »

looo wrote: Mon Nov 12, 2018 1:11 pm I remember reporting a patch to salome some time ago. But as the external smesh doesn't support libmed yet, I didn't have a look into this library anymore. for version 3.3.1 I used this patch to make the library work with python3.
We do not have an external smesh yet in Gentoo. I didn't have the time to investigate this package.
Thanks for your link though. The changes you made in python/CMakeLists.txt and on the SWIG files are worth trying. I will check whether this helps in solving my hack in a cleaner way.
User avatar
kkremitzki
Veteran
Posts: 2515
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: libmed (med file / med fichier) python3 bindings on linux

Post by kkremitzki »

Perhaps we should add a BUILD_MEDFILE_SUPPORT cmake flag.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
Post Reply