Hey Filip,
Kindly share details about your python installation, and also confirm if you are using the Anaconda distribution for python. The above error is common with Anaconda distribution.
This is because Anaconda maps the DLLs in a non-standard spot and adds them to the path when you start Anaconda's Prompts or Navigators. The math library uses python directly. To be fast, libraries uses compiled C-code, hence those extra DLLs.
In case you are using Anaconda, Here's a workaround:
- Launch Anaconda Prompt or Anaconda Powershell Prompt
- Type matlab at the prompt. Matlab will launch with extra environment variables configured by Anaconda's startup.
- Test in MATLAB.
Otherwise, If you are using any Python version > 3.8 with Windows, DLLs are only loaded from trusted locations as suggested in Python documentation: https://docs.python.org/3/whatsnew/3.8.html#ctypes
This can be fixed by adding the dll path in python using:
os.add_dll_directory("PATH_TO_DLL")
In case you still encounter the error, I recommend going through below documentation to ensure that your system is configured correctly:
I hope this helps!