- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone!
I am working on automating some analyses of results using the Python API. It would be very useful if I could install, or link to, external data science libraries (e.g., numpy) from CFD Python. So far, I have been unsuccessful.
I've tried the following:
- Install same version of Python that CFD uses (3.8) in another location on my system
- Install numpy using new interpreter (via pip)
- From CFD Python, add the numpy install location to the search path using sys.path.append("path/to/python3.8/Lib/site-packages").
This procedure does allow the CFD Python interpreter to find the packages installed for the other interpreter. I can even import external packages written in pure Python. However, numpy fails to import. Likewise, anything with numpy as a dependency (e.g., pandas, scipy) also fails. The issue appears to be a problem importing numpy's C-extensions. Below is the error output:
"""
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.8 from "C:\Program Files\Autodesk\CFD 2021\CFD.exe"
* The NumPy version is: "1.24.3"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: DLL load failed while importing _multiarray_umath: The specified module could not be found.
"""
I checked out troubleshooting guide mentioned in the error message. Unfortunately, it's not really applicable since I have no control over CFD's bundled Python installation.
Has anyone else encountered this? Or have suggestions? I am an experienced Python user with a fair amount of broader CFD knowledge, but I am new to Inventor CFD.
Thanks!
Luke
Solved! Go to Solution.