-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Unable to discover Pixi environment #23911
Comments
(Just to be clear, the |
@eightysteele Thanks for filing this. Also does this problem persist when you DONT have pixi for a Python project? |
@anthonykim1 no crash, the only symptom is that I cannot see any available Python interpreters for my Here's a repro.... I create a new Google Cloud VM (using From conda deactivate
curl -fsSL https://pixi.sh/install.sh | bash
source ~/.bashrc
pixi init pixi-py --pyproject
cd pixi-py/
mkdir pixi_py
touch pixi_py/__init__.py
conda deactivate
pixi add black
pixi add --pypi --feature test pytest
pixi add black --pypi
pixi add black[cli] --pypi
pixi install Then I install the official MS Python extension (pre-release) and open the "output" window and select "Python". Here's what i see: 2024-08-06 15:37:21.517 [info] Experiment 'pythonCreateEnvOnPipInstall' is active
2024-08-06 15:37:21.517 [info] Experiment 'pythonRecommendTensorboardExt' is active
2024-08-06 15:37:21.517 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2024-08-06 15:37:21.517 [info] Experiment 'pythonTestAdapter' is active
2024-08-06 15:37:21.517 [info] Default formatter is set to null for workspace /home/b3d/pixi-py
2024-08-06 15:37:21.517 [info] Starting Environment refresh
2024-08-06 15:37:21.517 [info] > pixi --version
2024-08-06 15:37:21.517 [error] [Error: spawn pixi ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
errno: -2,
code: 'ENOENT',
syscall: 'spawn pixi',
path: 'pixi',
spawnargs: [ '--version' ]
}
2024-08-06 15:37:21.517 [info] > hatch env show --json
2024-08-06 15:37:21.517 [info] cwd: .
2024-08-06 15:37:21.517 [warning] Failed to check if /usr/local/bin/python3 is an executable [Error: ENOENT: no such file or directory, lstat '/usr/local/bin/python3'] {
errno: -2,
code: 'ENOENT',
syscall: 'lstat',
path: '/usr/local/bin/python3'
}
2024-08-06 15:37:21.528 [info] > /usr/local/bin/python3 -I ~/.vscode-server/extensions/ms-python.python-2024.12.2-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2024.12.2-linux-x64/python_files/interpreterInfo.py
2024-08-06 15:37:21.528 [info] Environments refresh paths discovered: 451 milliseconds
2024-08-06 15:37:21.530 [error] [Error: Command failed: /usr/local/bin/python3 -I /home/b3d/.vscode-server/extensions/ms-python.python-2024.12.2-linux-x64/python_files/get_output_via_markers.py /home/b3d/.vscode-server/extensions/ms-python.python-2024.12.2-linux-x64/python_files/interpreterInfo.py
/bin/sh: 1: /usr/local/bin/python3: not found And then as a final thing, "Select Interpreter" doesn't show Hope that helps! |
For: #23911 and #23906 (For virtual/remote scenario) Locating pixi environment, regardless of presence of pixi environment, is leading to crash. Hoping to address this and handle errors more gracefully so program does not terminate. /cc @baszalmstra
@eightysteele Thanks much for detailed logs here. I just merged in #23937 so hopefully that will clear things out for us. Error should be less aggressive but also more verbose and detailed. That being said, starting TOMORROW, can you please give the latest pre-release of Python extension a try and see if you get the same symptoms + output logs? For your scenario, it seems more like the issue with discovery of pixi environment itself? My follow up questions are:
|
I have additional PR here: #23942 |
@anthonykim1 thank you! is there anything i can do to help test out these changes? |
Hello @eightysteele Can you install the latest pre-release version of Python extension and see if you can repro the problem? I've merged in #23937 and #23942 will be merged with approval. I would assume
will still be there without #23942, but error should all go away when #23942 is merged too. |
Hi @anthonykim1! In |
Hello @eightysteele Sorry that you are facing this :/ Was hoping that it would be auto-detected but we are seeing some issues with pixi discovery at the moment. Let me know how this goes! -Thanks |
I am hitting the same issue where the local pixi default env is never detected and I must enter its path manually every time. |
Could that be due to pixi introducing environments a few months ago? In short there is no one single env anymore such as |
@hadim when you enter the path for pixi, are you able to use that pixi environment? I'm curious of whether you are entering an absolute path, relative to workspace, etc
This is quite possible. And also related: #24042 I'm curious to see if switching the native locator setting to be set to "js" help with automatically detecting pixi environment for you guys. @eightysteele @hadim Thanks all for your support, |
Switching to python locator |
@hadim Working in a sense that your pixi environment is properly discovered, AND you were able to use that pixi environment, correct? |
yes exactly. all the pixi's envs in the current workspace are correctly detected and they also all work. |
@hadim that helps a ton, thank you for verifying that. I'm curious to see if the workaround works for @eightysteele too! |
Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off. Happy Coding! |
Type: Bug
I am connecting to a remote host (using Remote Development extension) that has a pixi project. I have the pre-release version of the MS Python extension. When I try to select a Python interpreter, none are available. I see this in the logs:
Extension version: 2024.13.2024080501
VS Code version: Code 1.92.0 (b1c0a14de1414fcdaa400695b4db1c0799bc3124, 2024-07-31T23:26:45.634Z)
OS version: Linux x64 6.9.3-76060903-generic
Modes:
Remote OS version: Linux x64 6.5.0-1023-gcp
python.languageServer
setting: DefaultUser Settings
Installed Extensions
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
webnn: disabled_off
A/B Experiments
The text was updated successfully, but these errors were encountered: