Skip to content

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

Closed

Description

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

Activity

  1. added
    bugIssue identified by VS Code Team member as probable bug
    needs PRReady to be worked on
    and removed
    feature-requestRequest for new features or functionality
    on Aug 2, 2024
  2. karthiknadig commented on Aug 2, 2024

    @karthiknadig
    Member
  3. tinvaan commented on Aug 10, 2024

    @tinvaan

    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.

  4. sfc-gh-melnacouzi commented on Sep 20, 2024

    @sfc-gh-melnacouzi

    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.

  5. 7sStudio commented on Sep 27, 2024

    @7sStudio

    Michel El Nacouzi (@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"]
  6. mangomatrix commented on Sep 30, 2024

    @mangomatrix

    Michel El Nacouzi (@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.

  7. Nekkowe commented on Oct 2, 2024

    @Nekkowe

    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.

  8. eleanorjboyd commented on Oct 3, 2024

    @eleanorjboyd
    Member

    Hi Nekkowe! (@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.

  9. Nekkowe commented on Oct 4, 2024

    @Nekkowe

    Hi Eleanor Boyd (@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>.
    
  10. eleanorjboyd commented on Oct 4, 2024

    @eleanorjboyd
    Member

    Anthony Kim (@anthonykim1) - might have more context on this

  11. anthonykim1 commented on Oct 4, 2024

    @anthonykim1

    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! (@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.

  12. Nekkowe commented on Oct 12, 2024

    @Nekkowe

    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! 😄

  13. amunger commented on Oct 24, 2024

    @amunger

    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? Karthik Nadig (@karthiknadig)

  14. karthiknadig commented on Oct 24, 2024

    @karthiknadig
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable buggood first issueneeds PRReady to be worked onverifiedVerification succeeded

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions