-
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. |
This comment was marked as off-topic.
This comment was marked as off-topic.
And what now? To open a new issue and ask to reopen this one? |
Downgrading Python extension to v2024.9.1 did not work for me either. Other version info from VSCode Version: 1.93.1 (user setup) |
@zljubisic You are probably right. It seems like mix of couple problems and confusions. Let's try to solve this puzzle one by one - that being said I'm putting up a PR to change log level on this pixi warning to see and hoping it will clear up things. https://github.com/microsoft/vscode-python/pull/24164/files this way pixi warnings won't be screaming at you even when you are irrelevant (you don't have pixi nor do not intend to use one) Can't connect the dots between how pixi warning is related to pytest at the moment. @clement-chaneching If you are still suffering from your pixi environment not being discovered, you can file a separate issue. Give #23975 (comment) a read for your pixi specific related problems though. @toddsayersshell FYI It is not Microsoft who closed this issue. Thanks |
@anthonykim1 thanks for your reply. PR you have mentioned will help us not to see pixi warning, but problem with pytest discovery within vscode remains. Which issue will track that? |
Downgrading the Python Extension initially has worked for me. Right now I am running v2024.14.1 and VSCode 1.93.1 without issues |
This comment was marked as off-topic.
This comment was marked as off-topic.
…24164) Reference: #23773 and #23773 (comment) It seems that pixi warnings may be confusing unnecessary confusion among folks who may not even intend to use pixi environment. Changing log level for clarity and further help diagnosing problems that may be unrelated to pixi.
this issue seems related with the incorrect environment being selected for python when testing: #24122 |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
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 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. |
@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. |
@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 I have a build here where we prioritize the Try pre-release version |
My code has no conda, has no pixi. Just |
@thethiny Did you try with the |
@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. |
I updated to the latest release and it didn't work. Then I switched python to |
@karthiknadig thank you for paying attention to this issue. |
I am using Poetry to manage my dependencies. I don't use either pixi or
conda (at least I am not consciously using either at my end).
Should the latest pre-release solve the problem in this configuration
Thanks & regards
Ashok Natesan
Cell: 669-333-4692
Streamlinity LLC
https://www.streamlinity.com
…On Wed, Oct 2, 2024 at 8:46 AM Anthony Kim ***@***.***> wrote:
@thethiny <https://github.com/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 <#24198>
helped re-prioritize conda over pixi. So people should really give a try on
the latest PRE-release of the Python extension.
—
Reply to this email directly, view it on GitHub
<#23773 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJ5KD2CB4NYQIXGZIOOJ3N3ZZQINFAVCNFSM6AAAAABKSVHEEWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBZGAYTINBRGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Hey @anthonykim1, this issue might need further attention. @adam-lagoda, you can help us out by closing this issue if the problem no longer exists, or adding more information. |
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: