skip to Main Content

I’m a little confused with this scenario about which python interpreter is used:

I use vscode to ssh to the python codes in a remote machine, and then I installed the python interpreter as VScode suggests. I was wondering which machine is the python interpreter installed. The remote machine or my local machine? I think it’s the remote one, but not 100% sure.

2

Answers


  1. When you use VSCode to SSH into a remote machine and install a Python interpreter as suggested by VSCode, the interpreter is installed on the remote machine, not on your local machine. VSCode simply acts as an interface to interact with the remote environment.

    Login or Signup to reply.
  2. If you performed the operation on a remote machine, it is installed on the remote machine.

    You can also use the following code to output the path of the current interpreter.

    import os
    import sys
    
    executable_path = sys.executable
    install_path = os.path.dirname(executable_path)
    
    print("Python executable path:", executable_path)
    print("Python install path:", install_path)
    

    More info:

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