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.

Warn users when a python environment has not been selected

See original GitHub issue

Ensure validation takes place in a central location when using features such as:

  • Formatting
  • Linting
  • Debugging, etc

Currently the only way users would know that this is necessary is:

  • If there are errors
  • Or if users notice the warning message displayed in the status bar

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:18 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
qubitroncommented, Jun 25, 2018

@kraigb fair enough, let’s link to python.org directly and can change it if we see users struggling with that approach. On macOS and Linux they have a system install but it is missing pip in both cases, I think we have a warning for macOS that the system install is not supported.

1reaction
DonJayamannecommented, Jun 25, 2018

Add on behalf of @kraigb

Ultimately, we’re trying to get the user to a point of immediate success with Python + VS Code, so I would think that whether they get there through a popup or the status bar is of secondary importance. In fact, selecting Python: Select Interpreter from the command palette is a third route already. The docs on https://code.visualstudio.com/docs/python/python-tutorial and https://code.visualstudio.com/docs/python/environments both illustrate the status bar very early on. Those articles are widely read, so the status bar is iscoverable enough given that it’s not a required interaction.

For consistency, we should agree on whether it’s “select interpreter” or “select environment”, as @DanielMoth points out, and use that in all cases.

I’d also suggest making the popups less about what’s not there and more about why, along with a clear directive. (Replace “interpreter” with “environment” depending on the consensus there):

No selected interpreter: “Select a Python interpreter by using the button below so Visual Studio Code can provide debugging, IntelliSense, and other language-related features.” Button “Select Python interpreter” No interpreter: “To work with Python in Visual Studio Code, install a Python interpreter by using the button below.” Button “Install Python interpreter” (goes to https://www.python.org/downloads/)

(BTW, for localization and accessibility it’s better to use words like “select” and “by using” rather than “click”.)

.Kraig

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python is in a Conda environment, but it has not been ...
The error message tells you that the Python interpreter from the Conda environment was found, but that conda activate <envname> has not been...
Read more >
Python interpreter or virtual environments not being listed ...
Actual: When opening a specific folder, the Python installation is not detected. A pop up stating that Python is not installed comes up....
Read more >
This Python interpreter is in a conda environment, but the ...
The resolve the "This Python interpreter is in a conda environment, but the environment has not been activated. Libraries may fail to load"...
Read more >
warnings — Warning control — Python 3.11.1 documentation
Warning messages are typically issued in situations where it is useful to alert the user of some condition in a program, where that...
Read more >
Configure a virtual environment | PyCharm Documentation
The main purpose of virtual environments is to manage settings and dependencies of a particular project regardless of other Python projects.
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