I see that on a newly installed Tumbleweed, only Python 3.10 is installed. No problem with that. However, there is no executable called 'python'. Only 'python3' and 'python3.10'. Is this a general thing? That perhaps 'python' always references Python 2? Would something break if I made a 'python' link to 'python3'? Obviously, the code called would need to expect it. And I can make sure that's the case for our code. But generally in Tumbleweed/Leap would this confuse something? -- Roger Oberholtzer
Hello, In the Message; Subject : python executable name Message-ID : <CANkOqwOpzWekFKOPFREGAuccztR4AtVh5DAYb1J=UmgAZyMgJg@mail.gmail.com> Date & Time: Mon, 19 Sep 2022 11:22:35 +0200 [RO] == Roger Oberholtzer <roger.oberholtzer@gmail.com> has written: RO> I see that on a newly installed Tumbleweed, only Python 3.10 is RO> installed. No problem with that. RO> However, there is no executable called 'python'. Only 'python3' and RO> 'python3.10'. RO> Is this a general thing? That perhaps 'python' always references RO> Python 2? RO> Would something break if I made a 'python' link to 'python3'? No, it doen't. As far as I know, the building condition /usr/bin/python -> python3.10 is required only for fetchmail. Moreover, this requirement is only for the build process, and has nothing to do with the operation of the system. So, please just do # ln -s /usr/bin/python3.10 /usr/bin/python RO> Obviously, the code called would need to expect it. And I can make RO> sure that's the case for our code. But generally in Tumbleweed/Leap RO> would this confuse something? For builds, it was only occasionally /usr/bin/python -> python2.7 was required, but if the Tumbleweed package is as you say, it may be fine to leave it as it is. Looking at the package at hand, there are certainly no packages that require python 2.7 in the present Tumbleweed. If you are not building any software, I don't think you need to do anything. I'll just remove a bunch of python2.7 related packages and see what happens. Anyway, when I installed Tumbleweed this past March, it was a combination of python 2.7 and python 3.8, but now it is python 2.7 and python 3.10. When I figured this out, I have removed everything related to python 3.8 accordingly. I think you should carefully watch the status of package's updates in this regard. Regards. --- ┏━━┓彡 Masaru Nomiya mail-to: nomiya @ galaxy.dti.ne.jp ┃\/彡 ┗━━┛ "A bachelor’s degree still holds prestige as a ticket to the middle class, but its value has received increasing scrutiny. In the last several years, rising tuition and student loan debt have led more Americans to reconsider an investment in postsecondary education." -- Washington Post --
On Mon, Sep 19, 2022 at 12:38 PM Masaru Nomiya <nomiya@galaxy.dti.ne.jp> wrote:
I'll just remove a bunch of python2.7 related packages and see what happens.
Anyway, when I installed Tumbleweed this past March, it was a combination of python 2.7 and python 3.8, but now it is python 2.7 and python 3.10.
When I figured this out, I have removed everything related to python 3.8 accordingly.
I think you should carefully watch the status of package's updates in this regard.
I have some other Tumbleweed systems that have a real mix. I would like to settle on one Python 3 version, and perhaps remove any Python2 packages. The trick is that IIRC there are some neutral packages like python-rpm-macros that one might want to keep. Something for a rainy day, I guess. -- Roger Oberholtzer
On 9/19/22 18:52, Roger Oberholtzer wrote:
I see that on a newly installed Tumbleweed, only Python 3.10 is installed. No problem with that.
However, there is no executable called 'python'. Only 'python3' and 'python3.10'.
Is this a general thing? That perhaps 'python' always references Python 2?
On openSUSE we have made the decision that /usr/bin/python will always be python 2, changing the shebang to /usr/bin/python3 provides a clear sign that the code has been ported. In the world outside openSUSE some distro's have done what we have and chosen to keep it as python 2 only while on others it changed to pointing to python3 when they made it there default.
Would something break if I made a 'python' link to 'python3'? Obviously, the code called would need to expect it. And I can make sure that's the case for our code. But generally in Tumbleweed/Leap would this confuse something?
If you uninstall and taboo the python2 package then this shouldn't cause issues with openSUSE packages, there is a very limited set of programs in the distro still using any bits of python2 and mostly they are related to building so its likely you can now remove python 2. If you were using an obs instance then obs will automatically add a python2 dependency for any package that it finds a script with #!/usr/bin/python As I said before third party stuff varies on what it expects /usr/bin/python to be but in general its best practice to put either #!/usr/bin/python2 or #!/usr/bin/python3 in your scripts depending on which you actually use. -- Simon Lees (Simotek) http://simotek.net Emergency Update Team keybase.io/simotek SUSE Linux Adelaide Australia, UTC+10:30 GPG Fingerprint: 5B87 DB9D 88DC F606 E489 CEC5 0922 C246 02F0 014B
Hello, In the Message; Subject : Re: python executable name Message-ID : <ae803b7d-0747-0118-4c11-7ff987cbdffc@suse.de> Date & Time: Mon, 19 Sep 2022 21:46:43 +0930 [SL] == Simon Lees <sflees@suse.de> has written: [...] SL> If you uninstall and taboo the python2 package then this shouldn't SL> cause issues with openSUSE packages, there is a very limited set SL> of programs in the distro still using any bits of python2 and SL> mostly they are related to building so its likely you can now remove SL> python 2. If you were using an obs instance then obs will SL> automatically add a python2 dependency for any package that it finds a SL> script with #!/usr/bin/python I tried to remove python2 in its entirety, but it said it would also remove lsb, even though gimp-plugins-python was fine, so I stopped. Regards. --- ┏━━┓彡 Masaru Nomiya mail-to: nomiya @ galaxy.dti.ne.jp ┃\/彡 ┗━━┛ Think. -- The IBM slogan --
Hello, In the Message; Subject : Re: python executable name Message-ID : <CANkOqwNDLzv-SZ7+J7kqEHy=22iYDgt9+3Q4WAGZjJf_TR+ZZg@mail.gmail.com> Date & Time: Mon, 19 Sep 2022 14:01:25 +0200 [RO] == Roger Oberholtzer <roger.oberholtzer@gmail.com> has written: RO> On Mon, Sep 19, 2022 at 12:38 PM Masaru Nomiya <nomiya@galaxy.dti.ne.jp> wrote: RO> > I'll just remove a bunch of python2.7 related packages and see what RO> > happens. RO> > RO> > Anyway, when I installed Tumbleweed this past March, it was a RO> > combination of python 2.7 and python 3.8, but now it is python 2.7 and RO> > python 3.10. RO> > RO> > When I figured this out, I have removed everything related to python RO> > 3.8 accordingly. RO> > RO> > I think you should carefully watch the status of package's updates in RO> > this regard. RO> I have some other Tumbleweed systems that have a real mix. I would RO> like to settle on one Python 3 version, and perhaps remove any Python2 RO> packages. The trick is that IIRC there are some neutral packages like RO> python-rpm-macros that one might want to keep. Something for a rainy RO> day, I guess. I very much agree with your view that "Simple Is Best". For that reason, we should keep an eye on the packaging trend in Tumbleweed, and I think YaST2 is a good tool for that. Regards. --- ┏━━┓彡 Masaru Nomiya mail-to: nomiya @ galaxy.dti.ne.jp ┃\/彡 ┗━━┛ "A bachelor’s degree still holds prestige as a ticket to the middle class, but its value has received increasing scrutiny. In the last several years, rising tuition and student loan debt have led more Americans to reconsider an investment in postsecondary education." -- Washington Post --
On 9/19/22 07:16, Simon Lees wrote:
On openSUSE we have made the decision that /usr/bin/python will always be python 2, changing the shebang to /usr/bin/python3 provides a clear sign that the code has been ported. In the world outside openSUSE some distro's have done what we have and chosen to keep it as python 2 only while on others it changed to pointing to python3 when they made it there default.
That's worth it's weight in gold. A clean way to go and avoids having to change the executable for all other packages (we know there are some helper packages, etc.. that are still python2) I've seen distros do the naming python2/python3, but just using python3 for python 3 make more sense. Either are doable. The good new here is we have the pronouncement from on-high about how it works on openSUSE -- that removes any uncertainty. Roger, I you have one app that needs a name change, then it may be worth a small script where you can rewrite the python name as needed as a one-off for launching whatever it is without having to drop a system-wide softlink. (though that is also an option if you have a slew of packages looking for 'python2' or 'python27' -- or whatever it may be. I just try and minimize those. -- David C. Rankin, J.D.,P.E.
participants (4)
-
David C. Rankin
-
Masaru Nomiya
-
Roger Oberholtzer
-
Simon Lees