[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Change the python interpretor to use /usr/bin/env python3
From: |
Darshit Shah |
Subject: |
Re: Change the python interpretor to use /usr/bin/env python3 |
Date: |
Mon, 2 Apr 2018 10:02:08 +0200 |
User-agent: |
NeoMutt/20180323 |
Hi,
Sorry for the sparse details. I was confused the first time I saw the issue as
well, but then I forgot to mention all the details.
I was trying to test building GNU Wget2 in a Fedora 27 docker container.
So, the I am talking about Fedora 27 on x86-64. But not the full version, just
what is available in the Docker container.
> address@hidden /]# ls -l /usr/bin/python*
> lrwxrwxrwx 1 root root 9 Feb 8 14:46 /usr/bin/python3 -> python3.6
> -rwxr-xr-x 1 root root 11240 Feb 8 14:46 /usr/bin/python3.6
> -rwxr-xr-x 1 root root 11240 Feb 8 14:46 /usr/bin/python3.6m
> address@hidden /]# dnf list --installed python*
> Installed Packages
> python3.x86_64
> 3.6.4-8.fc27
> @koji-override-0
> python3-dbus.x86_64
> 1.2.4-8.fc27
> @anaconda
> python3-dnf.noarch
> 2.7.5-2.fc27
> @koji-override-0
> python3-gpg.x86_64
> 1.9.0-6.fc27
> @anaconda
> python3-hawkey.x86_64
> 0.11.1-1.fc27
> @koji-override-0
> python3-iniparse.noarch
> 0.4-26.fc27
> @anaconda
> python3-libcomps.x86_64
> 0.1.8-6.fc27
> @anaconda
> python3-librepo.x86_64
> 1.8.0-1.fc27
> @anaconda
> python3-libs.x86_64
> 3.6.4-8.fc27
> @koji-override-0
> python3-pip.noarch
> 9.0.1-14.fc27
> @koji-override-0
> python3-rpm.x86_64
> 4.14.1-1.fc27
> @koji-override-0
> python3-setuptools.noarch
> 37.0.0-1.fc27
> @koji-override-0
> python3-six.noarch
> 1.11.0-1.fc27
> @anaconda
As you can see here, only Python 3 is installed in the base system. However,
contrary to expectations, python3 does not provide /usr/bin/python. That binary
is provided by the `python2` package on Fedora. Since python2 is not installed
by default in the docker container, this means that only the "/usr/bin/python3"
binary is available on that system.
However, I was mistaken about the call to `#!/usr/bin/env python` working. Only
`#!/usr/bin/env python3` works. Since Python 3 is the version that is being
specifically targeted, could we please change it to reflect that? As far as I'm
aware, all systems with Python 3 installed always have a python3 binary
available in $PATH. However, a /usr/bin/python may point to python 2 or 3.
* Dmitry Selyutin <address@hidden> [180402 09:44]:
> Hello,
>
> thank you for investigating this. I'm joining to questions asked by Paul;
> moreover, as far as I know specifying python is usually the most correct
> way to make python work regardless of version (i.e. it is supposed that one
> day there will be no distinction between python and python3).
> FWIW, the future reimplementation will drop python 2 entirely. And "python"
> branch uses /usr/bin/python too.
>
> пн, 2 апр. 2018 г., 6:52 Paul Eggert <address@hidden>:
>
> > Could you please clarify this? Which Fedora release and architecture, and
> > what
> > What is the output of 'ls -l /usr/bin/python*' and of 'dnf list --installed
> > 'python*''? That sort of thing. I don't understand why '#!/usr/bin/python'
> > would
> > fail at the same time that '#!/usr/bin/env python' worked. Thanks.
> >
> >
--
Thanking You,
Darshit Shah
PGP Fingerprint: 7845 120B 07CB D8D6 ECE5 FF2B 2A17 43ED A91A 35B6
signature.asc
Description: PGP signature