Home > Enterprise >  Python module not found even though its installed
Python module not found even though its installed

Time:10-31

Does anyone else have this issue? For reference check this screenshot: Error

PIP is also up to date and I already tried reinstalling it but it didn't work neither. I'm using VS Code. It also worked just fine yesterday but today it didn't anymore for some reason.

CodePudding user response:

you can try installing mss outside of the venv and see if that works. also check that the venv you're using is the right one according to vscode

CodePudding user response:

If you are using multiple versions of python or use any python version in appdata, without venv, you can try running "pip install mss" from elevated (administrator) cmd instance within python install directory/scripts, shown on the console image above. If it is not the right python version used in the project, same applies to any installed python version. If IDE is used check interpreter setting to determine which one is in play.

CodePudding user response:

If you are using a virtual environment, you can install you package directly there. For windows:

py -m pip install mss

More reading

The other solution can be to add the path of your package to sys.path:

import sys
my_pkgs_path = r'/home/.../my_pkgs'

if my_pkgs_path in sys.path:
    print('already in sys.path')
else:
    print('not found in sys.path')
    sys.path.append(my_pkgs_path)       
    print('Added to sys.path')
  • Related