formulahendry / formulahendry/vscode-code-runner

Improper Interpreter

Open
#524 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.4k
Forks
351
PR merge metrics
No merged PRs in 30d

Description

I have a project run under WSL where Python 3.6 is installed as a the virtual environment. In VS Code, the environment is selected and appears correctly specified in `settings.json` as:

`"python.pythonPath": "./venv/bin/",`

This was set by Selecting the Python interpreter as shown in the status bar in the second screen shot below.

I first noticed the issue as specified in [this issue](https://github.com/microsoft/python-language-server/issues/1131).

![Capture](https://user-images.githubusercontent.com/8951542/63651861-2595d200-c71f-11e9-9c80-aa7c2f5efb02.PNG)

The script above will execute perfectly fine from the VS Code terminal (using the environment specified in the settings file) but when run using CodeRunner and the Python Extension, the above output is displayed in the code pane.

I inserted a version check and commented out the print line. It turns out that the version of Python used in the coderunner workflow was the system version of 2.7 as shown below and not the active environment. Is this a bug or is there some other setting that I am missing?

![Capture](https://user-images.githubusercontent.com/8951542/63651983-53c7e180-c720-11e9-95ce-8b3fda1deab9.PNG)

I posted this question/issue in the python language server repo and was directed to the vs-code python repo where I posted [this question](https://github.com/microsoft/vscode-python/issues/7099). From there I was directed here. On three other machines I have been able to install my venv and then select that environment.

My system is as follows:

**Windows 10**
Version 1803 OS Build 17134.950

**WSL**
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic

**VS Code**
Version: 1.37.1 (system setup)
Commit: f06011ac164ae4dc8e753a3fe7f9549844d15e35
Date: 2019-08-15T16:17:55.855Z
Electron: 4.2.7
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.17134

**Extensions WSL-Installed**
Name: Code Runner
Version: 0.9.14

Name: Git History
Version: 0.4.6

Name: GitLens — Git supercharged
Version: 9.9.3

Name: Heroku
Version: 1.2.6

Name: Python
Version: 2019.8.30787

Name: VS Color Picker
Version: 1.0.0

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.