skip to Main Content

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.

4

Answers


  1. 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

    Login or Signup to reply.
  2. 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')
    
    Login or Signup to reply.
  3. 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.

    Login or Signup to reply.
  4. Your mss package is installed locally, but you are using a virtual environment to run code.

    enter image description here

    Two solutions:

    1. Switch the interpreter to the local interpreter, which is the c:UsersAnwenderAppDataLocal.... in your picture

    • Ctrl+Shift+P to open the command palette, search for and select Python:Select Interpreter

      enter image description here

    • Select the interpreter with the mss package installed

      enter image description here

    2. Install the mss package for your virtual environment

    • Select the virtual environment interpreter in the selection panel

      enter image description here

    • Create a new terminal activation environment

      enter image description here

    • Install mss package using command pip install mss

      enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search