I am running a python script on VS Code and I am getting a package importing error but only the first time I run it after opening VS Code. If I run the same script again I don't get any errors, which makes me think there is something important being loaded only after I run it the first time. Any ideas of what might be causing this? I am running a python script imports numpy (or pandas, which uses numpy). The error is shown below.
Exception has occurred: ImportError Unable to import required dependencies: numpy:
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.
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:\Users\gcampos.conda\envs<env name>\python.exe"
- The NumPy version is: "1.23.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.
To be clear, what is baffling to me is that the same script runs on the second try. Any thoughts on why?
Thank you.