Search code examples
pythonvirtualenvironment

Why Virtual Studio Code can't find my virtual environments instaled modules?


Always when I create a new Python project file, in Visual Studio Code, and I import some modules, it marks the ones VSC can't find, but they are already installed in virtual environments.

How can I fix this bug? Thanks!


Solution

  • Select and activate an environment By default, the Python extension looks for and uses the first Python interpreter it finds in the system path. If it doesn't find an interpreter, it issues a warning. On macOS, the extension also issues a warning if you're using the OS-installed Python interpreter, because you typically want to use an interpreter you install directly. In either case, you can disable these warnings by setting python.disableInstallationCheck to true in your user settings.

    Check this link: https://code.visualstudio.com/docs/python/environments