skip to Main Content

The python interpreter that I choose is python 3.7.16(tf:conda )which is set by anaconda. And its path in my computer is F:anacondaenvstfpython.exe.
In the user’s setting.json , I changed the interpreter path to F:anacondaenvstfpython.exe.

enter image description here

But when I run my code in vscode, it uses a different interpreter other than the one that I chose, and its path is F:python python 310 python.exe

enter image description here

2

Answers


  1. It is because your environment path of python is set to "F:python python 310 python.exe". You have to replace this path with the path you want in your Operation System environment path.

    Login or Signup to reply.
  2. Obviously you are using Code Runner to run the code. This is incorrect, because selecting an interpreter is a feature of Python extension, so the interpreter you choose is only valid for Python extensions (that is, the actual interpreter version in the lower right corner).

    If there is no special requirement, please use the official extension Python to execute the script.

    enter image description here

    The Run Code option is brought by Code Runner

    Code Runner does not use the settings made for the Python extension, so it executes the script using the python version configured by the system environment variable.

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