Default python version

I’m a bit stuck at the moment trying to determine ‘why’ python2.7 is installed … default install on SFOS is 3.8, or? Help!

python3 --version
Python 3.8.11

python --version gives nothing. This is on an x10 II with 4.4.0.72

I kinda got freaked because I’ve evidently got something going on:

[defaultuser@VollaPhone ~]$ python --version
Python 2.7.17

I also have stock 3.8 which is:

i | pyotherside-qml-plugin-python3-qt5             | Asynchronous Python 3 Bindings for Qt 5                               | package
i | python                                         | An interpreted, interactive, object-oriented programming language     | package
i | python-libs                                    | Runtime libraries for Python                                          | package
i | python3-base                                   | Python3 Interpreter                                                   | package
i | python3-imaging                                | Python's own image processing library                                 | package
i | python3-libs                                   | Python Interpreter shared library                                     | package
i | python3-sqlite                                 | Python3 module for sqlite                                             | package
i | youtube-dl-python                              | Embedded (python) version of youtube-dl for apps                      | package

Wonder what I did?

I don’t have a volla to doublecheck, but maybe some app pulled it ins as a dep?

The easiest test for checking which package needs a certain package:

rpm -e --test python

Also regarding some python being the default, there is no such thing between python 2 and python 3. At least not on Sailfish. Python 3 doesn’t have /usr/bin/python link if that’s what you mean by being default version. Python 3 is also not included in device images for officially supported devices.

[EDIT] Scratch that, I’m an idiot.

Looks like the major package which needs py2 is actually glibc.

I guess 2.7 being intalled in the build environment while python3 is optional causes an libc to pull in that.

I don’t know whether it can be buillt against py3 as well.

The other reason is probably historic.

Did SFOS 1.0 have python3 at all?

youtube-dl-python-2021.12.17+obs1-1.2.1.jolla.noarch appears to require python-libs-2.7.17 …

I was/am a bit worried since I have a number of apps which use io.thp.pyotherside and some of the refactoring I’m doing depends on python3… Hmmm.

But it looks like pyotherside-qml-plugin-python3-qt5 will take care of it being python3. Thanks for all your feedback!

You most certainly are not an idiot. I reserve the right to be the idiot around here :–)

youtube-dl

Ah, I believe that can be changed, I’ll look into moving that to python3.

There is already youtube-dl-python3 (for embedding), but the script needs python2 at the moment.

Slightly off topic, but Ubuntu has a package called python-is-python3 (or close to it) which has the sole purpose of providing python which is a symlink to python3. We are not alone in the python generation crisis :laughing:

That’s them fighting words.

There ain’t enough room on our small boat for two idiots!

Hmm. If you upgrade youtube-dl, I guess I’ll have to settle for ‘fool’?