skip to Main Content

All my code was running fine until I ran a Windows update and all of my imported libraries such as NumPy and API’s like OpenAI are now returning errors.

I already tried:

  • restarting again
  • rerunning pip installs
  • reinstalling python to latest version

errors:

Import "numpy" could not be resolved
Import "openai" could not be resolved

details: Python 3.10.10 on win32

Edit: I ran it in windows Powershell and it worked fine. My paths are fine. I think it is a problem with VSCode.

Please help thank you.

2

Answers


  1. Try to uninstall a Windows Update.

    Go to settings > Windows update > Update History > uninstall updates.

    Try this or Check environment variables path.

    Login or Signup to reply.
  2. Import "numpy" could not be resolved
    Import "openai" could not be resolved

    This is the reminder provided by intellisense of Pylance or Pylint.

    You have to provided the error report after you running the Python file.

    According to the reminder, you may choose the correct python interpreter. You can use shortcuts "Ctrl+Shift+P" and type "Python: Select Python Interpreter" to choose the correct interpreter which contains these two packages.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search