Home > Net >  VSCode: No module found even after installing
VSCode: No module found even after installing

Time:10-20

No matter whatever module I install, in VSCode, it just shows that no module is found.

enter image description here

If the requirement is already satisfied then why still not found? Please let me know...

Edit1:

Here's the pip version which is 3.10 but the version of python it is showing me is 3.9.7

enter image description here

enter image description here

CodePudding user response:

Although you have selected the python310 environment in the third picture, it has no influence at all. Without the activate command such as Activate.ps1, activate.bat, it will automatically search the python and pip depending on the system environment variable of Path.

Obviously, from the second picture, we can know the pip and the python were not in the same environment. Either you mess up the order in the Path, or your python3.9.7 without pip installed.

enter image description here

Such as this can cause the python and pip not in the same environment.

You can move down the python3.9.7 in the Path to avoid it. But it's recommended to create a virtual environment. If you don't know how to create a virtual environment you can refer to here.

CodePudding user response:

You have two versions of python installed, and you have used pip in one of them but not the one you are running.

if you want to ensure that you are running pip for the correct version, you can run:

python -m pip install pynput
  • Related