Installing Openturns with Pymc and Aesara

Hi everyone,

I have been using Anaconda Spyder to run Openturns with Pymc and Aesara. However, I cannot use Anaconda any longer. As an alternative, I have installed Miniforge and I have installed in an environment Spyder and a few packages using,

conda create -c conda-forge -n ot-pymc-env spyder numpy scipy pandas matplotlib sympy cython openturns pymc aesara

However, I get the following message when I try to import Openturns,

import openturns as ot
Traceback (most recent call last):

  Cell In[1], line 1
    import openturns as ot

  File ~\AppData\Local\miniforge3\envs\ot-pymc-env\lib\site-packages\openturns\__init__.py:49
    from .common import

  File ~\AppData\Local\miniforge3\envs\ot-pymc-env\lib\site-packages\openturns\common.py:12
    from . import _common

ImportError: DLL load failed while importing _common: 
    The specified procedure could not be found.

This error does not happen when I install Openturns without Pymc and Aesara. It did not happen either when I was using Anaconda. I have read somewhere that there was some sort of incompatibility in the past between Openturns and Theano (former Aesara).

Any help is more than welcome

Thanks in advance

Toni

1 Like

Hi Toni,

Thanks for using OpenTURNS! I am not familiar with the packages pymc and aesara or their respective requirements. Have you simply tried installing the packages in your new environment one by one instead of all at once? This might simplify the requirements optimization done by conda and possibly solve some conflicts.

Best regards,
Elias

Hi Elias,

Thank you for your prompt response. I have tried several ways to install it. To prevent conflicts, I have installed Spyder and all the packages at once making sure that everything came from the same channel.

Best
Toni

Someone I know has encountered the same issue, so I have reported it in the bug tracker:

@Toni are you also using Windows?

Hi @josephmure, Thanks for your response. Yes. I am using windows. As I am using the conda-forge repository, I have reported the issue here,

Installing Spyder with Openturns, Pymc and Aesara · Issue #186 · conda-forge/openturns-feedstock · GitHub

Best

Toni

Thanks for the report @Toni. As a workaround, maybe you could install OpenTURNS in your conda environment using pip? That worked for the user at the origin of my bug report in the OpenTURNS bug tracker.

Hi @josephmure, thanks for the tip. Unfortunately, same error. I have created the same environment without openturns

conda create -c conda-forge -n ot-pymc-env spyder numpy scipy pandas matplotlib sympy cython  pymc aesara

and I have installed openturns using

pip3 install openturns --user

Best

Toni

Hi Toni,

Depending on your usage, another temporary workaround could be to work on a Google Colab notebook (https://colab.research.google.com/). You can easily install your packages by using the following command in a cell:

>>> !pip install openturns
>>> !pip install matplotlib

Your environment should be saved by Google and you should install the packages only once.
I hope it helps,
Elias

1 Like

Hi!
Thank you so much for posting this message! I have this issue since OT1.20 and I was not able to solve it. I though it was related to Spyder, but it isn’t.
I do not know if you have seen the message of @jschuller on 2360. According to him, "this is due to a conflict with numpy (and scipy) mingw runtime". This is not related to Spyder. A workaround is:

$ pip install numpy --force-reinstall --no-deps

I checked it just now: it works fine!
Regards,
Michaël
PS
Actually, I used:

$ pip install numpy --force-reinstall --no-deps --user

because I have a user-install. (The --user option was suggested by pip after the command failed.)

Hi all, I have just tried it and it works perfectly for me.

Thanks all for your help

Best

Toni

this is fixed now:

2 Likes