Questions tagged [vscode-code-runner]

Code Runner is an open-source extension for Visual Studio Code. It enables you to run a variety of languages in Visual Studio Code, with support for every popular programming language including both legacy languages and those that have gained popularity in recent years.

Code Runner is a free, open-source extension for Visual Studio Code.

It enables you to run a variety of languages in Visual Studio Code, with support for every popular programming language including both legacy languages and those that have gained popularity in recent years: C, C++, Java, JavaScript, PHP, Python, Perl, Perl 6, Ruby, Go, Lua, Groovy, PowerShell, BAT/CMD, BASH/SH, F# Script, F# (.NET Core), C# Script, C# (.NET Core), VBScript, TypeScript, CoffeeScript, Scala, Swift, Julia, Crystal, OCaml Script, R, AppleScript, Elixir, Visual Basic .NET, Clojure, Haxe, Objective-C, Rust, Racket, AutoHotkey, AutoIt, Kotlin, Dart, Free Pascal, Haskell, Nim, D.

Resources

240 questions
28
votes
8 answers

VS Code Code Runner doesn't work with virtualenvs

I can't get Code Runner extension to work with virtualenvs. Whenever I try to run code that imports a library that is installed only in the virtualenv and not in the global Python installation I get an import error. Running the exact same code in…
25
votes
11 answers

VSCode: The term 'python' is not recognized...but py works

I just installed python on VS Code and I can't run any python code using python command. python command: Running the code seems to run python command by default and it does not recognize it. When I right click and choose Run Code it…
Bizhan
  • 16,157
  • 9
  • 63
  • 101
24
votes
3 answers

How to allow VS Code to take input from users?

I have installed Visual Studio Code 1.23.1 and added extensions - Python, Code Runner. With Code Runner, now I can see the Run Code symbol (triangle) and on highlighting it, I see the shortcut Ctrl + Alt + N. But when I try to use it to run the code…
300
  • 965
  • 1
  • 14
  • 53
20
votes
7 answers

Why doesn't Console.WriteLine work in Visual Studio Code?

I have scriptcs and coderunner installed on Visual Studio Code. When I run a simple program that includes Console.WriteLine("Test") I don't see any output. The program seems to run successfully and exits with code 0. Any suggestions? Here's all…
Matt West
  • 1,376
  • 1
  • 12
  • 18
17
votes
3 answers

How do I turn on word wrap for Output window in VS code?

I'm running my code using the extension "Code Runner" and would like the output to be displayed word-wrapped. Currently when I run it, it displays the output all in a single line even if it's a long line. I tried the setting "editor.wordWrap":…
14
votes
5 answers

In VSCode, how do you stop code that is running via the Code Runner extension?

I'm running a python flask server locally by clicking the run button in VSCode (provided by the Code Runner extension). How do I stop the server without closing and restarting VSCode?
GollyJer
  • 23,857
  • 16
  • 106
  • 174
14
votes
1 answer

Getting error: /bin/sh scriptcs: command not found

I'm using Visual Studio Code for Mac, running extension CodeRunner. I've got a simple program: using System; namespace HelloWorldApplication { class HelloWorld { static void Main(string[] args) { Console.WriteLine("hellowol"); } …
jamesfdearborn
  • 769
  • 1
  • 10
  • 26
10
votes
8 answers

Why is Code Runner using the old 2.7.1 version of Python instead of 3.x on OSX?

I am trying to use the newer version of Python but when I type: import sys print sys.version_info I get back: sys.version_info(major=2, minor=7, micro=1, releaselevel='final', serial=0) In the terminal when I enter python I get: Python 2.7.1…
DGDD
  • 1,370
  • 7
  • 19
  • 36
9
votes
6 answers

How to run javascript code in Visual studio code? /bin/sh: 1: node: not found

I just started learning programming and I installed Visual Studio Code to write javascript in. I installed the Code Runner extension, to help me run my code. Whenever I try to run my code it says: /bin/sh: 1: node: not found and nothing…
user7898234
6
votes
2 answers

Code Runner in VSCode is running in output instead of CMD in the Terminal

I just re-installed my VSCode for some reason and after downloading the Code Runner extension, it is processing all the commands in the OUTPUT window instead of CMD in the Terminal... I am compiling my C++ code so I want that cd and g++ command in…
user13168561
6
votes
1 answer

VSCode: Code Runner extension is unable to execute the code on git bash terminal?

I am trying to run a simple program "primeRange.cpp" using Code Runner extension available for VSCode. I have selected my default terminal as git bash in VSCode, but when I hit Run on top right corner, it sends the command to bash to run the…
6
votes
7 answers

VS Code Doesn't Recognize Python Virtual Environment

I'm using VS Code on a Mac to write Python code. I've created a virtual environment named 'venv' inside my project folder and opened VS Code in my project folder. I can see the venv folder in the Explorer pane. However, if I install a package…
Jim
  • 13,430
  • 26
  • 104
  • 155
5
votes
4 answers

How to avoid tempCodeRunnerFile.go appear in the project

When I execute Run Code in selection mode, there is a temp file called tempCodeRunnerFile.go will appear in the folder. How can I avoid this file appear in the project?
Will Huang
  • 2,955
  • 2
  • 37
  • 90
4
votes
0 answers

Running Python3 script in VS Code doesn't recognize environment variables unless running debugger (MacOS)

To clarify I set up the .env file for environment variables correctly and when I run the code either via the built-in terminal (default play button) or to output via the Code Runner plugin, the attempts to grab those environment variables always end…
4
votes
3 answers

Python Input function not Working in VS Code

balance = 100 print('Current Balance: ', balance) while balance > 0: print('1. WITHDRAW') print('2. DEPOSIT') choice = input("Select an option... ") if (choice == 1): print('1') elif…
1
2 3
15 16