Python bindings error solver-dummy

Hello,

I installed correctly preCICE 2.2.0 on Ubuntu 20.4 and tried many adapter tutorials. Everything works fine. Now I needed to use the python-bindings to connect to my mbdyn adapter which works with Python and I’m facing some problems.
I installed python bindings with the command: $ pip3 install --user pyprecice
I’m trying to run the solver-dummy in the python bindigs github repository and this is what I get:

$ pip3 install --user -r requirements.txt

ERROR: Could not find a version that satisfies the requirement pyprecice==2.0
ERROR: No matching distribution found for pyprecice==2.0

Thank you.

Alice

Hi!

What happens if you simply type

python -c "import precice; print(precice.__version__)"

in your terminal? Normall it should print the version of your bindings. This is a good indicator whether the bindings are installed at all or not. For me it looks like this:

$ python -c "import precice; print(precice.__version__)"
> v2.2.0.1

EDIT
At the moment, I assume that the requirements.txt is simply out of date as it strictly wants the bindings in version 2.0, but we have newer versions already. :smiley:

You could also try to skipping the “installation part” and directly try to use the solver dummies.

1 Like

This is what I get:

$ python -c “import precice; print(precice.version)”
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named precice

python3 -c “import precice; print(precice.version)”
v2.2.0.1

I’m encountering this problem also while using my mbdyn adapter. I cannot understand how to run the preCICE python-bindings also with version 2.

Ah. It makes sense that you need to use python3 instead of python as it depends on the system/Linux you are using.

The good news is that it looks like that your bindings are installed and working. Could you try to start the dummies without trying to install the requirements, i.e., go to the “Run” section immediately?

It works!

So I think I can safely assume that the problem is within the mbdyn python adapter. I have to find a way to make it compatible with python3

Thank you!

I have not used the mbdyn adapter, but if you could provide some information on how you installed it and what the problem is, maybe somebody could help. Maybe somebody else here has also information on the current state of the mbdyn adapter.

Related issue: Python-bindings with Python2 · Issue #88 · precice/python-bindings · GitHub

Just an addition. @Claudio was working on a MBDyn-adapter last year, see

However, I am not sure what the state of the adapter is and whether it was ever released under a open-source license.

1 Like

Hi all,
yes I have been working on an adapter for MBDyn, with a lot of convergence issues for high mass ratio. As a coincidence, I might have found a solution (or a workaround, I’m debating with the MBDyn developers) a couple of days ago and numbers look much prettier now :slightly_smiling_face: .
My adapter is written in C++ because at the beginning I had some issues with the results given by the MBDyn python bindings with some MBDyn constructs, but I don’t know if it was my fault or what.
Afaik, MBDyn python bindings should work with python 3, but I think that the current mbdyn adapter in the preCICE repository is written in python2.
Anyway, if anyone is interested in settig up a simulation using MBDyn, I would be very glad to cooperate.
kind regards
Claudio

3 Likes

@ajaust thank you for your addition. I’m developing a similar adapter for my master thesis (I’m using beam elements too) so this previous work helps me a lot!

By the way, after a lot of trials, I was finally able to use python3 with MBDyn. I switched from MBDyn 1.7.3 (latest version) to the develop version and that did the trick. Now MBDyn python interface is installed and works with the adapter.
I’m still facing major issues with the adapter but at least this problem was solved! :grinning:

@Claudio is your adapter present in the preCICE github repository?

Thank you all for your help!

2 Likes

Yes, recently they moved MBDyn to a gitlab repository, and the packed version (I believe 1.7.3 is of 2017…) and all the updates are there.

No, the current version is here: Claudio / MBDyn-esm-adapter · GitLab (the develop branch is the updated version), it is still a work in progress, in particular for the documentation. But if you want to somehow do some beta-testing… You are really welcome :slightly_smiling_face: . I can try to guide you in the installation process and case setup. It would me helpful also for me.

3 Likes

@Claudio thank you! I’ll download your adapter and I will let you know if I need guidance for the installation and the case setup (very likely).

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.