I was cloning a GitHub repository in GitHub Desktop, then moved the cloned file into a more convenient location. I then ran the GitHub repository and I got an error message:
ModuleNotFoundError: No module named 'numpy'
I thought this was odd, as I had already installed NumPy and used it regularly. I then went into a different Python file, which used NumPy and I was just using before perfectly fine and tried to run it. I got the same error again.
It seems that all my imports in every single Python file I have, in every location, no longer work. To verify that they are still installed, I ran: "pip install numpy", to which I got "Requirement already satisfied". What has happened? Python code without any imports works fine, and just anything which requires a library is broken.
It seems the error only occurs in Visual Studio Code - when I open a file with the Python IDE it works fine, but Visual Studio Code can’t find the module.