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

Consider not logging warnings when not applicable (for pixi envs) #23901

Closed
DonJayamanne opened this issue Aug 2, 2024 · 13 comments · Fixed by #24319
Closed

Consider not logging warnings when not applicable (for pixi envs) #23901

DonJayamanne opened this issue Aug 2, 2024 · 13 comments · Fixed by #24319
Labels
bug Issue identified by VS Code Team member as probable bug good first issue needs PR Ready to be worked on verified Verification succeeded
Milestone

Comments

@DonJayamanne
Copy link

I think warning messages are being logged as follows, however this is causing some confusion amongst users.
Suggestion is to turn this into trace or debug, else it could lead to false alarms.

2024-08-01 22:35:26.028 [warning] could not find a pixi interpreter for the interpreter at /Users/pi/code/2024/spins/.venv/bin/python
:

microsoft/vscode-jupyter#15911

@DonJayamanne DonJayamanne added the feature-request Request for new features or functionality label Aug 2, 2024
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Aug 2, 2024
@karthiknadig karthiknadig added bug Issue identified by VS Code Team member as probable bug good first issue needs PR Ready to be worked on and removed feature-request Request for new features or functionality labels Aug 2, 2024
@karthiknadig karthiknadig removed their assignment Aug 2, 2024
@karthiknadig karthiknadig added this to the August 2024 milestone Aug 2, 2024
@karthiknadig karthiknadig removed the triage-needed Needs assignment to the proper sub-team label Aug 2, 2024
@karthiknadig
Copy link
Member

Similar issue microsoft/vscode#223515

@tinvaan
Copy link

tinvaan commented Aug 10, 2024

Like most other users in the issue threads, I also don't know what pixi is and if I should make the effort to install it.

The warning message doesn't help because it doesn't give any info on what pixi is and what a user is required to do. Agree that it's better as a debug message, but in any case, adding some pointers to help the user remedy the issue would help.

In my case, IntelliSense suggestions stop working midway through my session(I reload the window and it's back to normal, before entering the same loop) and I see this warning followed by an ENOENT error in the output stream.

@sfc-gh-melnacouzi
Copy link

sfc-gh-melnacouzi commented Sep 20, 2024

I started having issue with running pytest with conda environment recently (last 2 weeks), and I see a similar message, and not sure if it is related.
My conda environment selected is called "testtest", so it's supposed to use that conda environment python env, which includes all the dependencies necessary to run the test. I can run pytest fine from a terminal, but when I open the test tab in vscode, I get:

2024-09-20 10:17:33.815 [info] > pixi --version
2024-09-20 10:17:33.816 [warning] could not find a pixi interpreter for the interpreter at /opt/homebrew/Caskroom/miniconda/base/envs/testtest/bin/python
2024-09-20 10:17:33.830 [info] > python -m pytest -p vscode_pytest --collect-only
2024-09-20 10:17:33.840 [info] cwd: .
2024-09-20 10:17:33.854 [error] /opt/homebrew/Caskroom/miniconda/base/bin/python: No module named pytest

Please note the 2 python paths attempted above:

  • first: /opt/homebrew/Caskroom/miniconda/base/envs/testtest/bin/python
  • second: /opt/homebrew/Caskroom/miniconda/base/bin/python

It seems that python extension is switching to using the base python module (instead of conda testtest env that was attempted first), just after the pixi error.

I also tried to install pixi and ran pixi --version, but pixi didn't have that command. I am not even sure if that's the pixi (pypi pixi) it's looking for.

I know I can install pytest in the base python env to fix this error, but then there are other dependencies that are missing as well, and defeats the purpose of using a conda environment with vscode.

Currently, can't run unit tests, and I can't find any help about this online.

Thanks

UPDATE: It turned out related to experiment pythonTestAdapter, which is broken with conda, as it tries to look for bin/python/bin/python instead of bin/python location.

@gitHoussem
Copy link

gitHoussem commented Sep 27, 2024

@sfc-gh-melnacouzi I am facing the exact same problem. Miniconda + python 3.11.9 on macos.
Here is what fixed my issue. In vscode settings I added :

"python.experiments.optOutFrom": ["pythonTestAdapter"]

@mangomatrix
Copy link

@sfc-gh-melnacouzi I am facing the exact same problem. Miniconda + python 3.11.9 on macos. Here is what fixed my issue. In vscode settings I added :

"python.experiments.optOutFrom": ["pythonTestAdapter"]

This worked for me.

@Nekkowe
Copy link

Nekkowe commented Oct 2, 2024

Didn't change a thing for me, oddly enough.

This is really irritating.
I'm glad I at least found this issue to explain that it wasn't anything wrong with my setup or project - it's just this plugin going "Hey, this thing you didn't install, never heard of, and have no intention of using? It looks like you don't have it set up." at [warning] level.

@eleanorjboyd
Copy link
Member

Hi @Nekkowe! Are you able to try on the most recent release and make sure your VS Code is also up to date? We moved it out of warning level recently so it shouldn't appear. Secondly this isn't explicitly related to "python.experiments.optOutFrom": ["pythonTestAdapter"] but the two could be correlated.

@Nekkowe
Copy link

Nekkowe commented Oct 4, 2024

Hi @eleanorjboyd!

Thank you for letting me know - on the latest release, the warning appears to changed to [warning] Dir <project path>/.pixi/envs" is not watchable (directory does not exist)

2024-10-04 10:42:02.993 [info] Telemetry level is off
2024-10-04 10:42:02.993 [info] Experiments are disabled, only manually opted experiments are active.
2024-10-04 10:42:02.993 [info] Experiment 'pythonTestAdapter' is inactive
2024-10-04 10:42:02.993 [warning] Dir "<path to my project>/.pixi/envs" is not watchable (directory does not exist)
2024-10-04 10:42:02.993 [info] Default formatter is set to null for workspace <path to my project>
2024-10-04 10:42:02.993 [info] > conda info --json
2024-10-04 10:42:02.993 [info] Python interpreter path: /bin/python3
2024-10-04 10:42:03.045 [info] > pyenv which python
2024-10-04 10:42:03.045 [info] cwd: .
2024-10-04 10:42:03.893 [info] Starting Jedi language server for <project>.

@eleanorjboyd
Copy link
Member

eleanorjboyd commented Oct 4, 2024

@anthonykim1 - might have more context on this

@anthonykim1
Copy link

anthonykim1 commented Oct 4, 2024

Yes, related: #23942
There has been couple PRs to log level down pixi as much as possible if deemed unnecessary for folks who do not even intend to use pixi at all.

traceWarn(`Dir "${root}" is not watchable (${unwatchable})`);

is the one message that I was very hesitant of leveling down further down.

@Nekkowe Are you trying to use pixi environment? Otherwise you could safely ignore that warning. We could look at leveling this down further just like https://github.com/microsoft/vscode-python/pull/24164/files.

@Nekkowe
Copy link

Nekkowe commented Oct 12, 2024

I wasn't trying to use pixi environment, nope - I'd never installed, heard of, or had any intention of using pixi. So you can imagine my confusion seeing this warning! 😄

@amunger amunger added the verified Verification succeeded label Oct 24, 2024
@amunger
Copy link

amunger commented Oct 24, 2024

I don't see any reference to pixi in the logs, is there any special environment type I need to set up to verify this or is that good enough? @karthiknadig

@karthiknadig
Copy link
Member

That is it. You should see something only if there is pixi installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug good first issue needs PR Ready to be worked on verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants