Skip to content

Ubuntu 20.04 without python-as-python3 apt package errors No such file or directory: 'python' #4416

@christopherpickering

Description

@christopherpickering
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: Ubuntu 20.04
  • Poetry version: 1.1.8

Issue

Attempting to run any poetry commands results in

Installing dependencies

  FileNotFoundError

  [Errno 2] No such file or directory: 'python'

  at /usr/lib/python3.8/subprocess.py:1704 in _execute_child
      1700│                     else:
      1701│                         err_filename = orig_executable
      1702│                     if errno_num != 0:
      1703│                         err_msg = os.strerror(errno_num)
    → 1704│                     raise child_exception_type(errno_num, err_msg, err_filename)
      1705│                 raise child_exception_type(err_msg)
      1706│ 
      1707│ 
      1708│         def _handle_exitstatus(self, sts, _WIFSIGNALED=os.WIFSIGNALED,

  FileNotFoundError

  [Errno 2] No such file or directory: 'python'

  at /usr/lib/python3.8/subprocess.py:1704 in _execute_child
      1700│                     else:
      1701│                         err_filename = orig_executable
      1702│                     if errno_num != 0:
      1703│                         err_msg = os.strerror(errno_num)
    → 1704│                     raise child_exception_type(errno_num, err_msg, err_filename)
      1705│                 raise child_exception_type(err_msg)
      1706│ 
      1707│ 
      1708│         def _handle_exitstatus(self, sts, _WIFSIGNALED=os.WIFSIGNALED,

  FileNotFoundError

  [Errno 2] No such file or directory: 'python'

  at /usr/lib/python3.8/subprocess.py:1704 in _execute_child
      1700│                     else:
      1701│                         err_filename = orig_executable
      1702│                     if errno_num != 0:
      1703│                         err_msg = os.strerror(errno_num)
    → 1704│                     raise child_exception_type(errno_num, err_msg, err_filename)
      1705│                 raise child_exception_type(err_msg)
      1706│ 
      1707│ 
      1708│         def _handle_exitstatus(self, sts, _WIFSIGNALED=os.WIFSIGNALED,
Env Info:

  FileNotFoundError

  [Errno 2] No such file or directory: 'python'

  at /usr/lib/python3.8/subprocess.py:1704 in _execute_child
      1700│                     else:
      1701│                         err_filename = orig_executable
      1702│                     if errno_num != 0:
      1703│                         err_msg = os.strerror(errno_num)
    → 1704│                     raise child_exception_type(errno_num, err_msg, err_filename)
      1705│                 raise child_exception_type(err_msg)
      1706│ 
      1707│ 
      1708│         def _handle_exitstatus(self, sts, _WIFSIGNALED=os.WIFSIGNALED,

In ubuntu 20.04 there is not "python" command, only "python3". If I install sudo apt-get install python-is-python3, then poetry starts to work again.

It would be nice if poetry picked python3 if there is no python instead of failing. There is a python installed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions