$ poetry -vvv show
Stack trace:
17 ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/cleo/application.py:327 in run
325│
326│ try:
→ 327│ exit_code = self._run(io)
328│ except BrokenPipeError:
329│ # If we are piped to another process, it may close early and send a
16 ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/console/application.py:190 in _run
188│ self._load_plugins(io)
189│
→ 190│ exit_code: int = super()._run(io)
191│ return exit_code
192│
15 ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/cleo/application.py:431 in _run
429│ io.input.interactive(interactive)
430│
→ 431│ exit_code = self._run_command(command, io)
432│ self._running_command = None
433│
14 ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/cleo/application.py:473 in _run_command
471│
472│ if error is not None:
→ 473│ raise error
474│
475│ return terminate_event.exit_code
13 ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/cleo/application.py:454 in _run_command
452│
453│ try:
→ 454│ self._event_dispatcher.dispatch(command_event, COMMAND)
455│
456│ if command_event.command_should_run():
12 ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/cleo/events/event_dispatcher.py:26 in dispatch
24│
25│ if listeners:
→ 26│ self._do_dispatch(listeners, event_name, event)
27│
28│ return event
11 ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/cleo/events/event_dispatcher.py:89 in _do_dispatch
87│ break
88│
→ 89│ listener(event, event_name, self)
90│
91│ def _sort_listeners(self, event_name: str) -> None:
10 ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/console/application.py:299 in configure_env
297│
298│ env_manager = EnvManager(poetry, io=io)
→ 299│ env = env_manager.create_venv()
300│
301│ if env.is_venv() and io.is_verbose():
9 ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env.py:891 in create_venv
889│
890│ cwd = self._poetry.file.parent
→ 891│ env = self.get(reload=True)
892│
893│ if not env.is_sane():
8 ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env.py:739 in get
737│ return self.get_system_env()
738│
→ 739│ return VirtualEnv(venv)
740│
741│ if env_prefix is not None:
7 ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env.py:1716 in __init__
1714│ # from inside the virtualenv.
1715│ if base is None:
→ 1716│ output = self.run_python_script(GET_BASE_PREFIX)
1717│ assert isinstance(output, str)
1718│ self._base = Path(output.strip())
6 ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env.py:1500 in run_python_script
1498│
1499│ def run_python_script(self, content: str, **kwargs: Any) -> int | str:
→ 1500│ return self.run(
1501│ self._executable, "-I", "-W", "ignore", "-", input_=content, **kwargs
1502│ )
5 ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env.py:1492 in run
1490│ def run(self, bin: str, *args: str, **kwargs: Any) -> str | int:
1491│ cmd = self.get_command_from_bin(bin) + list(args)
→ 1492│ return self._run(cmd, **kwargs)
1493│
1494│ def run_pip(self, *args: str, **kwargs: Any) -> int | str:
4 ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env.py:1776 in _run
1774│ def _run(self, cmd: list[str], **kwargs: Any) -> int | str:
1775│ kwargs["env"] = self.get_temp_environ(environ=kwargs.get("env"))
→ 1776│ return super()._run(cmd, **kwargs)
1777│
1778│ def get_temp_environ(
3 ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env.py:1523 in _run
1521│
1522│ if input_:
→ 1523│ output = subprocess.run(
1524│ command,
1525│ stdout=subprocess.PIPE,
2 /usr/lib/python3.10/subprocess.py:503 in run
501│ kwargs['stderr'] = PIPE
502│
→ 503│ with Popen(*popenargs, **kwargs) as process:
504│ try:
505│ stdout, stderr = process.communicate(input, timeout=timeout)
1 /usr/lib/python3.10/subprocess.py:971 in __init__
969│ encoding=encoding, errors=errors)
970│
→ 971│ self._execute_child(args, executable, preexec_fn, close_fds,
972│ pass_fds, cwd, env,
973│ startupinfo, creationflags, shell,
FileNotFoundError
[Errno 2] No such file or directory: 'python'
at /usr/lib/python3.10/subprocess.py:1847 in _execute_child
1843│ else:
1844│ err_filename = orig_executable
1845│ if errno_num != 0:
1846│ err_msg = os.strerror(errno_num)
→ 1847│ raise child_exception_type(errno_num, err_msg, err_filename)
1848│ raise child_exception_type(err_msg)
1849│
1850│
1851│ def _handle_exitstatus(self, sts,
$ head -n1 ~/.local/bin/poetry
#!/home/sam/.local/pipx/venvs/poetry/bin/python
$ readlink /home/sam/.local/pipx/venvs/poetry/bin/python
python3
$ readlink /home/sam/.local/pipx/venvs/poetry/bin/python3
/usr/bin/python3
Poetry version:
Poetry (version 1.3.2)(installed with pipx)Python version:
Poetry
Version: 1.3.2
Python: 3.10.9
[Errno 2] No such file or directory: 'python'
OS version and name: Debian GNU/Linux bookworm/sid
pyproject.toml: pyproject.toml
I am on the latest stable Poetry version, installed using a recommended method.
I have searched the issues of this repo and believe that this is not a duplicate.
I have consulted the FAQ and blog for any relevant entries or release notes.
If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption) and have included the output below.Issue
Many poetry commands (e.g.,
poetry show,poetry env infofail with[Errno 2] No such file or directory: 'python'.Seems like
poetry.utils.env.GenericEnvis trying to run"python"instead of referring tosys.executableto get the python interpreter executable name.pipx has set up the venv for Poetry like so:
So there is a
pythoncommand but it's not in thePATH; it only exists in the pipx-managed venv.