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:
- Created 2 years ago
- Reactions:11
- Comments:24 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have this issue as well
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.