skip to Main Content

I’m new to using VS Code and wish to use this with Python (which I am new to as well)

Followed all the install instructions of both Python and Visual Studio as well as installing the Python Extension.

Checking Terminal and this confirms that Python is installed and the extension is installed in VS code.

However, when I try to run a simple script on Python, I get the below error.

VS Code Error

Here is my terminal to show Python Installed
Terminal Script

I have researched extensively and watch multiple videos and can’t see where I am going wrong.

I read something about updating PATH and BASH profile, but I don’t really have the knowledge in this space.

Any help would be greatly appreciated.

Edit, adding in code

Python Code

2

Answers


  1. Chosen as BEST ANSWER

    Issue here was Code Runner Extension which I had installed after following a couple of tutorial videos.

    Having removed this extension and running the code again, it is now working.

    Script


  2. For your original problem, you could open your User settings and search for "code-runner.executorMap".

    Set "python": "python3 -u", in this setting.

    By the way, I suggest you using Run Python File button which provided by Microsoft Python extension.

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