4 ms·
Anyone know if /usr/bin/python will point to python3?
by mkj 9y ago
Anyone know if /usr/bin/python will point to python3?
- deleted 9y ago[deleted]
- mappu 9y agoEventually - Fedora are planning to work with upstream to amend PEP394, so that python means python3. https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3 https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPytho...
- ersh 9y agoThat would be really bad. The new scripts should just use the right #! string
- jhasse 9y agoIt could be configurable (like with /usr/bin/c++) or at least be the case when python2 isn't installed.
- gray_-_wolf 9y agoor just use `#!/usr/bin/env python2` (python3) and don't care what is actually on the drive
- moviuro 9y ago#!/usr/bin/env python2 There, fixed it. Much like `#!/usr/bin/env bash` for bash scripts instead of `#!/bin/bash` (which won't work on many OSes) https://github.com/search?q=%23%21%2Fusr%2Fbin%2Fenv+python2&type=Code https://github.com/search?q=%23%21%2Fusr%2Fbin%2Fenv+python2...
- saurik 9y agoYou can't "there fixed it" for the infinite number of projects that exist in the field that this breaks. "It never worked on FreeBSD" is very different from "it no longer works on new versions of RHEL".
- throwaway2048 9y agoif changing a hashbang is that big of a deal, the codebase is completely mortibund going forward, and support is dropping in 2020 anyways. I don't think people should be concerned about people that are that totally resistant to change.
- Sir_Cmpwn 9y ago>You can't "there fixed it" for the infinite number of projects that exist in the field that this breaks Of course you can. Python files are plaintext. $ find ./some/module -name "*.py" -exec sed -e 's:#!/usr/bin/python:#!/usr/bin/env python2:g' -i {} ;
- akerro 9y agoIt already does ~ ls -las /usr/bin/python 0 lrwxrwxrwx 1 root root 7 Jan 5 02:36 /usr/bin/python -> python3
- enedil 9y agoWhat distribution are you on? My latest (!) stable Fedora still points at py2: ~ $ ls -als /usr/bin/python 0 lrwxrwxrwx. 1 root root 7 Mar 14 14:36 /usr/bin/python -> python2*
- metalliqaz 9y agoEven though it obviously still works, using "python" is no longer the recommended way to launch Python applications. You are supposed to use "python2" or "python3" if you care about which version you run with.