# Python bindings error solver-dummy

**URL:** <https://precice.discourse.group/t/python-bindings-error-solver-dummy/502>\
**Category:** Installing preCICE\
**Tags:** adapters, python\
**Created:** [March 4, 2021, 8:17am UTC](https://precice.discourse.group/t/python-bindings-error-solver-dummy/502 "2021-03-04T08:17:36Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![alicezanella](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/alicezanella/32/589_2.png) [@alicezanella](https://precice.discourse.group/u/alicezanella)\
**Post date:** [March 4, 2021, 8:17am UTC](https://precice.discourse.group/t/python-bindings-error-solver-dummy/502/1 "2021-03-04T08:17:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ajaust](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/ajaust/32/160_2.png) [@ajaust](https://precice.discourse.group/u/ajaust)\
**Post date:** [March 4, 2021, 9:01am UTC](https://precice.discourse.group/t/python-bindings-error-solver-dummy/502/2 "2021-03-04T09:01:35Z")

</div>

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. 😃

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

---

<div class="post-metadata">

**Author:** ![alicezanella](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/alicezanella/32/589_2.png) [@alicezanella](https://precice.discourse.group/u/alicezanella)\
**Post date:** [March 4, 2021, 9:06am UTC](https://precice.discourse.group/t/python-bindings-error-solver-dummy/502/3 "2021-03-04T09:06:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ajaust](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/ajaust/32/160_2.png) [@ajaust](https://precice.discourse.group/u/ajaust)\
**Post date:** [March 4, 2021, 9:55am UTC](https://precice.discourse.group/t/python-bindings-error-solver-dummy/502/4 "2021-03-04T09:55:15Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![alicezanella](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/alicezanella/32/589_2.png) [@alicezanella](https://precice.discourse.group/u/alicezanella)\
**Post date:** [March 4, 2021, 10:01am UTC](https://precice.discourse.group/t/python-bindings-error-solver-dummy/502/5 "2021-03-04T10:01:36Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![ajaust](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/ajaust/32/160_2.png) [@ajaust](https://precice.discourse.group/u/ajaust)\
**Post date:** [March 4, 2021, 10:09am UTC](https://precice.discourse.group/t/python-bindings-error-solver-dummy/502/6 "2021-03-04T10:09:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Makis](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/makis/32/25_2.png) [@Makis](https://precice.discourse.group/u/Makis)\
**Post date:** [March 5, 2021, 7:39am UTC](https://precice.discourse.group/t/python-bindings-error-solver-dummy/502/7 "2021-03-05T07:39:25Z")

</div>

Related issue: [Python-bindings with Python2 · Issue #88 · precice/python-bindings · GitHub](https://github.com/precice/python-bindings/issues/88)

---

<div class="post-metadata">

**Author:** ![ajaust](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/ajaust/32/160_2.png) [@ajaust](https://precice.discourse.group/u/ajaust)\
**Post date:** [March 5, 2021, 8:28am UTC](https://precice.discourse.group/t/python-bindings-error-solver-dummy/502/8 "2021-03-05T08:28:36Z")

</div>

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

> [@FSI2 FSI3 Turek Hron benchmark comparison](https://precice.discourse.group/t/fsi2-fsi3-turek-hron-benchmark-comparison/282):
>
> Hi everyone, after the interesting conversation during the latest preCICE community hour, I’d like to share my configuration and to see if there is something that could be improved. As a short recap, I am working on an MBDyn adapter and I’m using it to couple beam elements in a FSI coupling. Up to now I have managed to replicate the Turek Hron benchmark results for the FSI2 benchmark (some results are in this post: [preCICE adapter for MBDyn solver for beam elements](https://precice.discourse.group/t/precice-adapter-for-mbdyn-solver-for-beam-elements/239/6)). Summarizing: FSI2 conve…

> [@preCICE adapter for MBDyn solver for beam elements](https://precice.discourse.group/t/precice-adapter-for-mbdyn-solver-for-beam-elements/239):
>
> Hi, I am working on an adapter to couple [MBDyn](https://www.mbdyn.org/) with PreCICE. MBDyn is a moltibody dynamics analysis software. In particular I am working on beam elements. In MBDyn external structural elements are used to exchange load/kinematic information between MBDyn and a CFD solver when beam-like structures are used. Basically I am using the PreCICE interface mesh as a cloud of external points that send forces to the beam nodes and are moved in relation to the beam movement. I am testing my adapter both …

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

---

<div class="post-metadata">

**Author:** ![Claudio](https://avatars.discourse-cdn.com/v4/letter/c/7cd45c/32.png) [@Claudio](https://precice.discourse.group/u/Claudio)\
**Post date:** [March 5, 2021, 8:50am UTC](https://precice.discourse.group/t/python-bindings-error-solver-dummy/502/9 "2021-03-05T08:50:47Z")

</div>

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 🙂 .  
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

---

<div class="post-metadata">

**Author:** ![alicezanella](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/alicezanella/32/589_2.png) [@alicezanella](https://precice.discourse.group/u/alicezanella)\
**Post date:** [March 5, 2021, 4:35pm UTC](https://precice.discourse.group/t/python-bindings-error-solver-dummy/502/10 "2021-03-05T16:35:21Z")

</div>

@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! 😀

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

Thank you all for your help!

---

<div class="post-metadata">

**Author:** ![Claudio](https://avatars.discourse-cdn.com/v4/letter/c/7cd45c/32.png) [@Claudio](https://precice.discourse.group/u/Claudio)\
**Post date:** [March 5, 2021, 4:57pm UTC](https://precice.discourse.group/t/python-bindings-error-solver-dummy/502/11 "2021-03-05T16:57:35Z")

</div>

> [@alicezanella](#):
>
> 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.

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.

> [@alicezanella](#):
>
> @Claudio is your adapter present in the preCICE github repository?

No, the current version is here: [Claudio / MBDyn-esm-adapter · GitLab](https://gitlab.com/stilita/mbdyn-esm-adapter) (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 🙂 . I can try to guide you in the installation process and case setup. It would me helpful also for me.

---

<div class="post-metadata">

**Author:** ![alicezanella](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/alicezanella/32/589_2.png) [@alicezanella](https://precice.discourse.group/u/alicezanella)\
**Post date:** [March 6, 2021, 8:07am UTC](https://precice.discourse.group/t/python-bindings-error-solver-dummy/502/12 "2021-03-06T08:07:05Z")

</div>

@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).

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/precice/original/1X/67d2a5fa6f80e597e2267ff17fa8c1673cd11caa.svg) [@system](https://precice.discourse.group/u/system)\
**Post date:** [March 9, 2021, 8:07am UTC](https://precice.discourse.group/t/python-bindings-error-solver-dummy/502/13 "2021-03-09T08:07:30Z")

</div>

Closed on March 9, 2021, 8:07am UTC

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