Repository navigation
Pixi errror when loading pytest in VS code #23773
Copy link
Copy link
Closed
Labels
info-neededIssue requires more information from posterIssue requires more information from postertriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
Description
Type: Bug
Behaviour
I get a pytest discovery error when starting pytest from the vs code testing window. The systems utilizes micromamba as the python package manager, with an alias set up between conda -> micromamba. The error originates from pixi not being found,
Steps to reproduce:
- Use micromamba environment that is activated in powershell
- Open VSCode and the testing toolbar (with the Python Extension set to 2024.10.0)
- Tests will not be discovered
Diagnostic data
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
XXX
Extension version: 2024.10.0
VS Code version: Code 1.91.0 (ea1445cc7016315d0f5728f8e8b12a45dc0a7286, 2024-07-01T18:52:22.949Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Remote OS version: Linux x64 5.15.153.1-microsoft-standard-WSL2
- Python version (& distribution if applicable, e.g. Anaconda): 3.11.9
- Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Micromamba
- Value of the
python.languageServersetting: Default
User Settings
condaPath: "<placeholder>"
languageServer: "Pylance"
testing
• pytestArgs: "<placeholder>"
• pytestEnabled: true
Installed Extensions
| Extension Name | Extension Id | Version |
|---|---|---|
| autoDocstring - Python Docstring Generator | njpwerner.autodocstring | 0.6.1 |
| CodeSnap | adpyke.codesnap | 1.3.4 |
| CSV to Table | phplasma.csv-to-table | 1.4.0 |
| Data Wrangler | ms-toolsai.datawrangler | 1.4.1 |
| FindItFaster | TomRijndorp.find-it-faster | 0.0.38 |
| Git Graph | mhutchie.git-graph | 1.30.0 |
| GitLens — Git supercharged | eamodio.gitlens | 15.1.0 |
| Hex Editor | ms-vscode.hexeditor | 1.10.0 |
| JavaScript Debugger | ms-vscode.js-debug | 1.91.0 |
| json | ZainChen.json | 2.0.2 |
| Jupyter | ms-toolsai.jupyter | 2024.6.0 |
| Jupyter Cell Tags | ms-toolsai.vscode-jupyter-cell-tags | 0.1.9 |
| Jupyter Notebook Renderers | ms-toolsai.jupyter-renderers | 1.0.18 |
| Jupyter Slide Show | ms-toolsai.vscode-jupyter-slideshow | 0.1.6 |
| Live Preview | ms-vscode.live-server | 0.4.13 |
| Path Intellisense | christian-kohler.path-intellisense | 2.9.0 |
| Pretty Formatter | mblode.pretty-formatter | 0.2.4 |
| Pylance | ms-python.vscode-pylance | 2024.6.1 |
| Python | ms-python.python | 2024.11.2024070801 |
| Python Debugger | ms-python.debugpy | 2024.6.0 |
| Rainbow CSV | mechatroner.rainbow-csv | 3.12.0 |
| SQLite | alexcvzz.vscode-sqlite | 0.14.1 |
| SVG | jock.svg | 1.5.4 |
| Table Visualizer for JavaScript Profiles | ms-vscode.vscode-js-profile-table | 1.0.9 |
| Todo Tree | Gruntfuggly.todo-tree | 0.0.226 |
System Info
| Item | Value |
|---|---|
| CPUs | 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz (8 x 2995) |
| GPU Status | 2d_canvas: enabled 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: enabled vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: enabled |
| Load (avg) | undefined |
| Memory (System) | 23.71GB (5.42GB free) |
| Process Argv | --folder-uri=vscode-remote://wsl+Ubuntu-22.04/home/adam/Documents/Git/QUIET --remote=wsl+Ubuntu-22.04 |
| Screen Reader | no |
| VM | 0% |
| Item | Value |
|---|---|
| Remote | WSL: Ubuntu-22.04 |
| OS | Linux x64 5.15.153.1-microsoft-standard-WSL2 |
| CPUs | 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz (8 x 0) |
| Memory (System) | 11.54GB (9.78GB free) |
| VM | 0% |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
info-neededIssue requires more information from posterIssue requires more information from postertriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
Activity
adam-lagoda commentedon Jul 9, 2024
rafrafek commentedon Jul 9, 2024
I have the same issue that started occurring after the latest VS Code Python extension update. I use Poetry to create my virtual environments, and I don't even know what Pixi is.
I'm getting a "pytest Discovery Error" and am unable to launch any tests in VS Code.
adam-lagoda commentedon Jul 9, 2024
I have tested that downgrading to v2024.8.1 works Rafał (@rafrafek). However this is a temporary solution, and I would highly appreciate fixing the bug by the core team
rafrafek commentedon Jul 9, 2024
My logs:
eleanorjboyd commentedon Jul 9, 2024
Hi! What version of pytest are you using? It might be due to you being on a older version and updating might fix your problem.
rafrafek commentedon Jul 9, 2024
Hi! I'm using version
7.4.4, and updating to the latest version8.2.2fixed the issue in my case. I'm not the author of this issue, though, so I would wait to confirm if it helps in that case.paulf81 commentedon Jul 10, 2024
I have also had this issue
jk1man1 commentedon Jul 10, 2024
I had the same problem. It seems that having the pytest verion
7.4.4, and updating to the latest version8.2.2, fixed the issue on my endadam-lagoda commentedon Jul 10, 2024
I have now checked my environment package versions, and I had pytest running also running on
7.4.4, however, as jk1man1 and Rafał (@rafrafek) pointed out,8.2.2works out of the box. I have also tested, and7.4.0works as well.I am therefore closing this issue, as not relevant for
vscode-python46 remaining items
toddsayersshell commentedon Sep 25, 2024
oldgithubman commentedon Sep 26, 2024
anatesan-stream commentedon Sep 26, 2024
karthiknadig commentedon Sep 26, 2024
We are actively investigating this. The short answer is, we are not able to isolate the issue. If we can't isolate it, we may have to revert
pixisupport. We want to avoid revertingpixisupport which is a community contributed feature.If you are running into this, and it is blocking, pin the extension to a previous version.
I will be marking anything that does not directly help us address this issue as off topic. I understand the frustration, we are investigating this. Off-topic comments are not helpful to get us to resolving this issue.
zljubisic commentedon Sep 27, 2024
Karthik Nadig (@karthiknadig) If you want to isolate issue, create a new python project, install pytest, write a test and try to debug it. You will see that test is not found. Maybe it will brake after some number of tests, so you have to write more than one test.
While vscode is braking, executing pytest from the shell works as expected.
karthiknadig commentedon Sep 27, 2024
zljubisic I have tried to repro this on few repos with 70k tests. Unfortunately, I can't repro it. the hypothesis is that it seems to be related some state of the environment that makes
pixicategorize it as non conda.I have a build here where we prioritize the
condacategory overpixi. If this works then it means that the issue is with forming the activation commands thatpixitakes over when. If this does not bypass it then we need to look further.Try pre-release version
ms-python.python.2024.15.2024092702, it requires latest VS Code insiders.thethiny commentedon Sep 30, 2024
My code has no conda, has no pixi. Just
main.pyandtests/test_code.pykarthiknadig commentedon Sep 30, 2024
thethiny (@thethiny) Did you try with the
ms-python.python.2024.15.2024092702build to see what happens?AngelFP commentedon Oct 1, 2024
Karthik Nadig (@karthiknadig) I just happened to experience this issue today. I switched to the latest prerelease version (it says v2024.17.2024100102) and now the tests are working again.
thethiny commentedon Oct 1, 2024
I updated to the latest release and it didn't work. Then I switched python to
pre-releaseand they're working fine.zljubisic commentedon Oct 1, 2024
Karthik Nadig (@karthiknadig) thank you for paying attention to this issue.
Unfortunately, I can't update to VS Code insiders and also I wouldn't be happy with pre-lease version of the python extension.
I am creating virtual environments using (mini)conda. I don't know if this helps.
anthonykim1 commentedon Oct 2, 2024
thethiny (@thethiny) ms-python.python.2024.15.2024092702 mentioned would be the pre-release version, so I think you are getting the expected result.
Looks like #24198 helped re-prioritize conda over pixi. So people should really give a try on the latest PRE-release of the Python extension.
anatesan-stream commentedon Oct 2, 2024
github-actions commentedon Nov 2, 2024
Hey Anthony Kim (@anthonykim1), this issue might need further attention.
Adam Lagoda (@adam-lagoda), you can help us out by closing this issue if the problem no longer exists, or adding more information.