question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue
  • 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.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:11
  • Comments:24 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
luisacabs-outcommented, Aug 23, 2021

I have this issue as well

3reactions
finswimmercommented, Aug 20, 2021

Thanks for your response! I’m able to reproduce it. It seems to be due to a change in poetry 1.1.8. I have no problems with 1.1.7. I guess https://github.com/python-poetry/poetry/issues/4414 is somehow related.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ubuntu /usr/bin/env: python: No such file or directory
Problem scenario: /usr/bin/env: 'python': No such file or directory. Possible Solution #1. If Python 3 is not installed, install it: apt-get install python3....
Read more >
How to make 'python' program command execute Python 3?
Save this answer. On Ubuntu 20.10+ apt install python3-pip will install both a pip and a pip3 command, both of which will be...
Read more >
How to fix: 'python': No such file or directory - My Cyber Universe
In the terminal, type the following commands and press the Enter key to install the python3 package, if it is not already installed....
Read more >
Unable to upgrade Python 3.8.10 to 3.10 - SOLVED
Hi, I tried to upgrade Python 3.8.10 to 3.10 on Ubuntu : Ubuntu 20.04.4 LTS but we hit a blocker and wondering whether...
Read more >
How to fix the `/usr/bin/python: not found` error in Ansible
Set ansible_python_interpreter: /usr/bin/python3 variable for all hosts that have python3 installed by default; Install Python 2 using Ansible's raw module ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found