Module not found error in VS code despite the fact that I installed it

After installing a new module via pip reloading vscode may work if vscode doesn’t recognize it. To do this, make sure that the module is installed inside the virtual environment by creating and activating a virtualenv:

python3 -m venv env
source env/bin/activate

Make sure to 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. After that, make sure to reload vscode by clicking Ctrl+Shift+P, and selecting Reload window.

Now vscode will know the new module and autocompletion works.

Leave a Comment