Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Most likely, some will rename the command and some will not, causing more pain for everyone :(


I like using `<python_executable> -m pip` to avoid all ambiguity about what python version I'm running pip with/installing things for. Usually `python3 -m pip`, or `python3.8 -m pip`.


I like using pyenv to manage Python versions which will then always symlink "pip" and "python" to whichever version is my system default, directory tree default, shell default, virtualenv etc.


This is already the case. Arch has python for python 3 and python2 for python 2. It's the opposite on Ubuntu and most other distros.


Ubuntu 20.04 has python2 and python3 executables, but no python, so no ambiguity.


This is absolutely my favourite way of doing it. If I need a `python` executable then I'll just make the symlink myself.


`sudo apt-get install python-is-python3` can fix that.


On Fedora:

    $ python --version
    Python 3.9.1


Arch is why there's a PEP saying not to do that.


The PEP [0] has been revised since then, and the current recommendation regarding /usr/bin/python is "equivalent to python2 OR equivalent to python3 OR not available at all OR configurable by user/sysadmin".

[0] https://www.python.org/dev/peps/pep-0394/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: