Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conda install on Windows: cannot import OpenTURNS #2360

Closed
josephmure opened this issue Aug 10, 2023 · 9 comments
Closed

Conda install on Windows: cannot import OpenTURNS #2360

josephmure opened this issue Aug 10, 2023 · 9 comments
Labels

Comments

@josephmure
Copy link
Collaborator

Hi! A Windows user sent me the following error:

import openturns as ot

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\...\AppData\Local\miniforge3\lib\site-packages\openturns\__init__.py", line 49, in <module>
    from .common import *
  File "C:\Users\...\AppData\Local\miniforge3\lib\site-packages\openturns\common.py", line 12, in <module>
    from . import _common
ImportError: DLL load failed while importing _common: La procédure spécifiée est introuvable.

This user did a fresh install of Miniforge3 for Windows: https://github.com/conda-forge/miniforge/releases/download/23.1.0-3/Miniforge3-23.1.0-3-Windows-x86_64.exe

On this fresh install, he ran the command to install openturns and pandas:

conda install openturns pandas

After the install (which reported no error), Pandas could be imported, but OpenTURNS could not (see error message above).

@josephmure josephmure added the bug label Aug 10, 2023
@josephmure
Copy link
Collaborator Author

Note that this user was in the end able to install and import OpenTURNS, but had to use pip.

@josephmure
Copy link
Collaborator Author

Update: the same issue has been reported by @antonio-canavate on our forum and the conda-forge bug tracker.

@amole-arup
Copy link

I have also had this problem with openturns in a micromamba environment. I installed everything using micromamba from conda-forge channel (including openturns). It only occurs when importing in a Spyder console. I haven't had any problem when using VS Code.

image

@jschueller
Copy link
Member

jschueller commented Aug 28, 2023

yep, this is due to a conflict with numpy (and scipy) mingw runtime

a workaround is to use numpy binary from pip:
pip install numpy --force-reinstall --no-deps

@amole-arup
Copy link

Are you saying that it is a conflict between Spyder and NumPy? If you are talking about a direct conflict, then it does not make sense to me because I didn't have any errors when I imported when using VS Code (see screen capture). The environment is exactly the same as the one where I had an import error above.

image

@jschueller
Copy link
Member

jschueller commented Aug 28, 2023

no between openturns and numpy, the latter being pulled by spyder

@amole-arup
Copy link

That seems to be a strange behaviour by Spyder. Why would it pull in a different version of NumPy than the one provided in the Environment?

@antonio-canavate
Copy link

Hi @jschueller, I have just tried and it works perfectly.

Thanks a lot

Best

Toni

@jschueller
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants