commaai / openpilot

openpilot is an open source driver assistance system. openpilot performs the functions of Automated Lane Centering and Adaptive Cruise Control for 250+ supported car makes and models.
https://comma.ai/
MIT License
48.65k stars 8.82k forks source link

Enforce using `python3` instead of `python` #32761

Open adeebshihadeh opened 3 weeks ago

adeebshihadeh commented 3 weeks ago

I'm trying out 24.04 where we want to be able to use the system python, but I'm hitting this:

adeeb:~$ python
Command 'python' not found, did you mean:
  command 'python3' from deb python3
  command 'python' from deb python-is-python3

What do other projects do?

BBBmau commented 3 weeks ago

Looks like they opted out of including use/bin/python in 24.04

https://utcc.utoronto.ca/~cks/space/blog/python/Ubuntu2404PythonState

We could include a step in the setup to do some kind of aliasing

adeebshihadeh commented 3 weeks ago

That's not the problem here. AFAIK python is always supposed to be python2 (or at least ambiguous) and python3 should be preferred. We used pyenv to make python always refer to our python install, however we want to drop the need for pyenv soon.

AbhishekChaudharii commented 2 weeks ago

Installing python-is-python3 package might solve your issue. sudo apt install python-is-python3

The package includes a symbolic link that directs the /usr/bin/python interpreter to the current default python3 version.