-
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
Pixi errror when loading pytest in VS code #23773
Comments
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. |
I have tested that downgrading to v2024.8.1 works @rafrafek. However this is a temporary solution, and I would highly appreciate fixing the bug by the core team |
My logs: 2024-07-09 14:41:13.122 [info] Experiment 'pythonCreateEnvOnPipInstall' is active
2024-07-09 14:41:13.122 [info] Experiment 'pythonRecommendTensorboardExt' is active
2024-07-09 14:41:13.122 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2024-07-09 14:41:13.122 [info] Experiment 'pythonTestAdapter' is active
2024-07-09 14:41:13.122 [error] Reading directory to watch failed [Error: ENOENT: no such file or directory, scandir '/Users/username/Projects/project-name/.pixi/envs'
at Object.readdirSync (node:fs:1515:3)
at t.readdirSync (node:electron/js2c/node_init:2:11289)
at /Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/out/client/extension.js:2:574598
at /Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/out/client/extension.js:2:574789
at Array.map (<anonymous>)
at d.initWatchers (/Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/out/client/extension.js:2:574507)
at async d.ensureWatchersReady (/Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/out/client/extension.js:2:536827)] {
errno: -2,
syscall: 'scandir',
code: 'ENOENT',
path: '/Users/username/Projects/project-name/.pixi/envs'
}
2024-07-09 14:41:13.122 [error] Dir "/Users/username/Projects/project-name/.pixi/envs" is not watchable (directory does not exist)
2024-07-09 14:41:13.154 [info] Default formatter is set to null for workspace /Users/username/Projects/project-name
2024-07-09 14:41:13.157 [info] Python interpreter path: ./.venv/bin/python
2024-07-09 14:41:13.282 [info] > pyenv which python
2024-07-09 14:41:13.282 [info] cwd: .
2024-07-09 14:41:13.915 [info] > pixi --version
2024-07-09 14:41:13.916 [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-07-09 14:41:13.916 [warning] could not find a pixi interpreter for the interpreter at /Users/username/Projects/project-name/.venv/bin/python
2024-07-09 14:41:14.487 [warning] could not find a pixi interpreter for the interpreter at /Users/username/Projects/project-name/.venv/bin/python
2024-07-09 14:41:14.497 [info] > . ./.venv/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/python_files/printEnvVariables.py
2024-07-09 14:41:14.497 [info] shell: bash
2024-07-09 14:41:14.527 [warning] could not find a pixi interpreter for the interpreter at /Users/username/Projects/project-name/.venv/bin/python
2024-07-09 14:41:14.528 [info] > ./.venv/bin/python -m pytest -p vscode_pytest --collect-only tests
2024-07-09 14:41:14.528 [info] cwd: .
2024-07-09 14:41:14.657 [error] Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pytest/__main__.py", line 5, in <module>
raise SystemExit(pytest.console_main())
^^^^^^^^^^^^^^^^^^^^^
File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 192, in console_main
code = main()
^^^^^^
File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 150, in main
2024-07-09 14:41:14.658 [error] config = _prepareconfig(args, plugins)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 331, in _prepareconfig
config = pluginmanager.hook.pytest_cmdline_parse(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_hooks.py", line 265, in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_callers.py", line 55, in _multicall
gen.send(outcome)
File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/helpconfig.py", line 104, in pytest_cmdline_parse
config: Config = outcome.get_result()
^^^^^^^^^^^^^^^^^^^^
File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_result.py", line 60, in get_result
raise ex[1].with_traceback(ex[2])
2024-07-09 14:41:14.658 [error] File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1075, in pytest_cmdline_parse
2024-07-09 14:41:14.658 [error] self.parse(args)
File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1425, in parse
self._preparse(args, addopts=addopts)
File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1301, in _preparse
2024-07-09 14:41:14.659 [error] self.pluginmanager.consider_preparse(args, exclude_only=False)
File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 709, in consider_preparse
2024-07-09 14:41:14.659 [error] self.consider_pluginarg(parg)
File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 735, in consider_pluginarg
2024-07-09 14:41:14.659 [error] self.import_plugin(arg, consider_entry_points=True)
File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 781, in import_plugin
2024-07-09 14:41:14.659 [error] __import__(importspec)
2024-07-09 14:41:14.659 [error] File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/assertion/rewrite.py", line 186, in exec_module
exec(co, module.__dict__)
File "/Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/python_files/vscode_pytest/__init__.py", line 895, in <module>
class DeferPlugin:
File "/Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/python_files/vscode_pytest/__init__.py", line 896, in DeferPlugin
@pytest.hookimpl(wrapper=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: HookimplMarker.__call__() got an unexpected keyword argument 'wrapper'
2024-07-09 14:41:14.676 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /Users/username/Projects/project-name.
2024-07-09 14:41:14.677 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /Users/username/Projects/project-name. Creating and sending error discovery payload
2024-07-09 14:41:14.677 [error] pytest test discovery error for workspace: /Users/username/Projects/project-name
The python test process was terminated before it could exit on its own, the process errored with: Code: 1, Signal: null for workspace /Users/username/Projects/project-name |
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. |
Hi! I'm using version |
I have also had this issue |
I had the same problem. It seems that having the pytest verion |
my error log is all the same |
Hi, seems like this is actually this error: #23707 and therefore a duplicate. I am putting in a fix hopefully today for it. Lmk if you aren't seeing this error and are seeing something else and I can reopen thank you! |
If someone wants to stay on |
Ive got the same problem which started today. Am using Python 3.10.6, pytest-8.2.2, pluggy-1.5.0. [warning] could not find a pixi interpreter for the interpreter at c:\venv\Scripts\python.exe The python test process was terminated before it could exit on its own, the process errored with: Code: 1, Signal: null for workspace |
@garganpaull are you trying to use pixi? |
No. I dont even know what Pixi is. My colleague does not have this issue and is running Pytest version is 7.2.0, Python version is 3.10.2 using VS Code v1.86.2. Im using VS Code 1.91.1, Python 3.10.6, pytest-8.2.2, pluggy-1.5.0. This issue only started for me yesterday when I upgraded my VS Code |
my steps to a solution:
ended up with |
I am actually also encountering this pixi error on my VS Code after the update. Right now, pytest Discovery is displaying errors that I have never seen before. My current Versions are: Here is the complete error: `2024-07-12 15:09:10.914 [info] Experiment 'pythonaacf' is active 2024-07-12 15:09:16.987 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace c:<project_name>. The python test process was terminated before it could exit on its own, the process errored with: Code: 1, Signal: null for workspace c:<project_name> |
I can report the same problem. In my output log I can find: Apart from it, I can also find this in my output log: 2024-07-16 12:18:22.351 [info] INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/_pytest/main.py", line 271, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
2024-07-16 12:18:22.351 [info] INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/_pytest/main.py", line 324, in _main
INTERNALERROR> config.hook.pytest_collection(session=session)
INTERNALERROR> File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
INTERNALERROR> return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/pluggy/_callers.py", line 181, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/pluggy/_result.py", line 99, in get_result
INTERNALERROR> raise exc.with_traceback(exc.__traceback__)
INTERNALERROR> File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/_pytest/main.py", line 335, in pytest_collection
INTERNALERROR> session.perform_collect()
INTERNALERROR> File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/_pytest/main.py", line 677, in perform_collect
INTERNALERROR> self.config.pluginmanager.check_pending()
INTERNALERROR> File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/pluggy/_manager.py", line 384, in check_pending
INTERNALERROR> raise PluginValidationError(
INTERNALERROR> pluggy._manager.PluginValidationError: unknown hook 'pytest_xdist_auto_num_workers' in plugin <vscode_pytest.DeferPlugin object at 0x7f1936d327d0> I don't know if it is related to pixi. |
Is this fixed yet as problem still persists. |
Can you try with Python 3.10.14? Python 3.10.6 is 2 years old and there were many fixes between 3.10.6 and 3.10.14. |
Also having this issue. I have no idea about or intention to use Pixi. |
Dir "/workspaces/EARL-CAPEX-API/.pixi/envs" is not watchable (directory does not exist) This is untrue; I explicitly created that path... and yet the error persists. pluggy 1.5.0 Linux e0655aa2f2f5 5.15.0-117-generic #127-Ubuntu SMP Fri Jul 5 20:13:28 UTC 2024 x86_64 GNU/Linux |
Hello, I am also having the same error but I am willing to use pixi:
It says it cannot find pixi interpreter, but I actually have pixi installed and setup as my python interpreter. |
Same error here and this is the first I've heard of pixi |
I was able to fix this by upgrading pytest to the latest version. I suggest everyone who is encountering this do it too. |
@anthonykim1, could you circle around on this as you have made fixes in this area? Thanks! |
You won't see the --version as error nor "2024-07-16 12:15:12.324 [error] Reading directory to watch failed [Error: ENOENT: no such file or directory, scandir '/home/path_to_the_project/.pixi/envs'". Try clearing the output and downloading the latest version of Python extension. Related: https://github.com//pull/23942 |
I have upgraded from pytest 8.3.2 to 8.3.3 but still have the same warning, which I believe is preventing Python/pytest to find packages in my
|
@bernardo-suez Your errors do not appear to be related to this issue. I'm not attempting to defend Github or Microsoft (I'm pretty annoyed with them, TBH). However... You appear to have problem with your PYTHONPATH and/or how you are attempting to import packages. This appears to be unrelated to the Pixi errors we're describing, here. EDIT: Ah... I do see that the very first line mentions the Pixi issue. Honestly... I've given up on the GH/MS dev team. I just have to ignore that error. The OTHER errors are unrelated. Also... Windows??? Level-up, yo... |
Wake me up when Linux has proper HDR support (I do main Linux though) |
@eleanorjboyd can you please help us solving this issue? |
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:
Diagnostic data
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)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.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: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
The text was updated successfully, but these errors were encountered: