Why do I get a “ModuleNotFoundError” in VS Code despite the fact that I already installed the module?

After installing a new module via pip, and vscode doesn’t recognize it,
Reloading vscode may work.

Make sure the module is installed inside the virtual environment by creating and activating a virtualenv:

python3 -m venv env
source env/bin/activate

Use the correct way of installing a module with pip:

python3 -m pip install new_module

Replace the string “new_module” with your module name.

Reload vscode by clicking Ctrl+Shift+P, and selecting Reload window.

Now vscode will know the new module and autocompletion works.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)