Python Binding

201 views
Skip to first unread message

Felix Felix

unread,
Sep 2, 2022, 1:15:52 PM9/2/22
to deal.II User Group
Deal all,

could someone teach me on how do I use the python binding. It says that I should import the package from the tutorial 1 file. But I don't understand how to do it. Could someone here be kind enough to teach me or tell me the steps?

Best regards,
Felix

Bruno Turcksin

unread,
Sep 2, 2022, 2:15:24 PM9/2/22
to deal.II User Group
Felix,

First, you need to configure deal.II using -DDEAL_II_COMPONENT_PYTHON_BINDINGS=ON. Then you need to re-compile and re-install the library. Now the wrappers are built but you still need to tell python where to find them. You can do that by setting the PYTHONPATH to the directory where pydealii is located. Now you should be able to call `import PyDealII.Debug` from python.

Best,

Bruno

Felix Felix

unread,
Sep 13, 2022, 6:59:48 AM9/13/22
to deal.II User Group
Hi Bruno,
thanks for the reply I have done what you told me to but I am now still unable to import PyDealII.Debug
as you've seen below I have added the pydealii directory to the path as well.

Screenshot from 2022-09-13 12-53-07.png


is there anything that I may lack.
I have re-compiled and re-installed the library too so I'm not very sure where my mistake lies.

Cheers,
Felix

Bruno Turcksin

unread,
Sep 13, 2022, 9:11:46 AM9/13/22
to dea...@googlegroups.com
Felix,

You need to use the path where you have installed the library. It looks like you have compiled the library but not installed it. The PYTHONPATH you want to use is /home/felixelf/Deal.II/build/python3.10/site-packages (I don't remember if site-packages should be in the path or not)

Best,

Bruno

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/hxM1sVThjZ0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/fd410517-24e5-40d1-9666-fa7e26d94f55n%40googlegroups.com.

Felix Felix

unread,
Oct 5, 2022, 11:17:24 AM10/5/22
to deal.II User Group
Hi 

Thank you Bruno for your help I have resolved the issue, it turns out I had many problems throughout the installations with my directories. 
I reinstalled and reconfigured everything and it has now worked smoothly. 

Bruno Turcksin

unread,
Oct 5, 2022, 11:27:59 AM10/5/22
to dea...@googlegroups.com
Felix,

Glad to hear it is working and thank you for letting us know.

Best,

Bruno

Reply all
Reply to author
Forward
0 new messages