question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot Select Python Interpreter when running python prints out more than the script output

See original GitHub issue

Issue Type: Bug

vscode

Behaviour

VS Code cannot select a python interpreter from the list of available interpreters. The list in the command flashes and dissappears.

Expected vs. Actual Behaviour

Expected vscode to set the interpreter to the selected version of python after clicking on the item.

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Install python
  2. Install vscode
  3. Install python extension
  4. Attempt to select a python interpreter

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda):
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Unknown
  • Value of the python.languageServer setting: Default
User Settings


defaultLS: {"defaultLSType":"Pylance"}

downloadLanguageServer: true

envFile: "<placeholder>"

venvPath: "<placeholder>"

venvFolders: "<placeholder>"

condaPath: "<placeholder>"

pipenvPath: "<placeholder>"

poetryPath: "<placeholder>"

languageServer: "Pylance"

linting
• enabled: true
• cwd: "<placeholder>"
• Flake8Args: "<placeholder>"
• flake8Enabled: false
• flake8Path: "<placeholder>"
• lintOnSave: true
• banditArgs: "<placeholder>"
• banditEnabled: false
• banditPath: "<placeholder>"
• mypyArgs: "<placeholder>"
• mypyEnabled: false
• mypyPath: "<placeholder>"
• pycodestyleArgs: "<placeholder>"
• pycodestyleEnabled: false
• pycodestylePath: "<placeholder>"
• prospectorArgs: "<placeholder>"
• prospectorEnabled: false
• prospectorPath: "<placeholder>"
• pydocstyleArgs: "<placeholder>"
• pydocstyleEnabled: false
• pydocstylePath: "<placeholder>"
• pylamaArgs: "<placeholder>"
• pylamaEnabled: false
• pylamaPath: "<placeholder>"
• pylintArgs: "<placeholder>"
• pylintPath: "<placeholder>"

sortImports
• args: "<placeholder>"
• path: "<placeholder>"

formatting
• autopep8Args: "<placeholder>"
• autopep8Path: "<placeholder>"
• provider: "autopep8"
• blackArgs: "<placeholder>"
• blackPath: "<placeholder>"
• yapfArgs: "<placeholder>"
• yapfPath: "<placeholder>"

testing
• cwd: "<placeholder>"
• debugPort: 3000
• nosetestArgs: "<placeholder>"
• nosetestsEnabled: undefined
• nosetestPath: "<placeholder>"
• promptToConfigure: true
• pytestArgs: "<placeholder>"
• pytestEnabled: false
• pytestPath: "<placeholder>"
• unittestArgs: "<placeholder>"
• unittestEnabled: true
• autoTestDiscoverOnSaveEnabled: true

terminal
• activateEnvironment: true
• executeInFileDir: "<placeholder>"
• launchArgs: "<placeholder>"

experiments
• enabled: false
• optInto: []
• optOutFrom: []

insidersChannel: "off"

tensorBoard
• logDirectory: "<placeholder>"

Extension version: 2021.12.1559732655 VS Code version: Code 1.63.2 (899d46d82c4c95423fb7e10e68eba52050e30ba3, 2021-12-15T09:40:02.816Z) OS version: Windows_NT x64 10.0.18362 Restricted Mode: No

System Info
Item Value
CPUs Intel® Xeon® CPU E5-1660 v4 @ 3.20GHz (16 x 3193)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.92GB (20.39GB free)
Process Argv –crash-reporter-id 669db187-2cae-415a-8e1c-4efb2f799c4c
Screen Reader no
VM 0%

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:19 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
irenepccommented, Jan 13, 2022

That’s fair. Our company does a lot work with Maya so we’re stuck with 27 for a little longer, but I appreciate the help! PS: everything behaves as expected after installing that last VSIX. Thank you!

0reactions
karrtikrcommented, Jan 13, 2022

Thanks for the logs, can you try this VSIX: https://github.com/microsoft/vscode-python/suites/4923442209/artifacts/142096276?

Although do note that as Python 2.7 is now deprecated, we aren’t actively supporting it anymore, I’m making an exception here. You should probably migrate to using Python3 soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

2. Using the Python Interpreter — Python 3.11.1 documentation
The interpreter prints a welcome message stating its version number and a copyright notice before printing the first prompt: $ python3.11 Python 3.11...
Read more >
Printing Python version in output - Stack Overflow
Try import sys print(sys.version). This prints the full version information string. If you only want the python version number, then Bastien ...
Read more >
Get Started Tutorial for Python in Visual Studio Code
This tutorial introduces you to VS Code as a Python environment, primarily how to edit, run, and debug code through the following tasks:....
Read more >
Python console | PyCharm Documentation - JetBrains
Configure Python console settings ... Select any available interpreter from the Python interpreter list. Note that you cannot introduce a new ...
Read more >
How to Set Up Visual Studio Code in 2022 (The Easy Way)
REPL stands for Read, Evaluate, Print, Loop. It's an interactive way of working with the Python interpreter and running the command directly ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found