Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruff failing to start when used directly in notebook #675

Open
AWH1122 opened this issue Jan 26, 2025 · 1 comment
Open

Ruff failing to start when used directly in notebook #675

AWH1122 opened this issue Jan 26, 2025 · 1 comment
Labels
question Asking for support or clarification

Comments

@AWH1122
Copy link

AWH1122 commented Jan 26, 2025

When ruff is being used exclusively in a notebook it fails to start. Here is the log output:

2025-01-26 19:54:52.014 [info] Name: Ruff
2025-01-26 19:54:52.014 [info] Module: ruff
2025-01-26 19:54:52.014 [info] Python extension loading
2025-01-26 19:54:52.014 [info] Waiting for interpreter from python extension.
2025-01-26 19:54:52.088 [info] Python extension loaded
2025-01-26 19:54:52.111 [error] Python interpreter missing:
[Option 1] Select Python interpreter using the ms-python.python.
[Option 2] Set an interpreter using "ruff.interpreter" setting.
Please use Python 3.7 or greater.

If I create a .py file, select and interpreter, then restart the language server it works.

Steps to Reproduce:

  1. Open jupyter notebook
  2. Try to format document and notice ruff is not working
@dhruvmanila
Copy link
Member

Thanks for the report.

Unfortunately, I'm not sure if this is a bug in Ruff extension because we use the Python extension to query the currently selected Python interpreter (refer to the screenshot, in the toolbar it says "Select interpreter" which is coming from the Python extension as it's unable to determine it for the project). As mentioned in the logs, one of the ways to resolve this would to use the ruff.interpreter setting. We're also looking into improving the UX for this part especially for the native server because we could skip this step if the extension is unable to get a Python executable (#598).

Image

@dhruvmanila dhruvmanila added the question Asking for support or clarification label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking for support or clarification
Projects
None yet
Development

No branches or pull requests

2 participants