Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Is Python3 now standard on Debian 11 Bullseye?
Is Python3 now standard on Debian 11 Bullseye?
Hi,
I'm a little confused on what the status of the migration from Python 2 to 3 is.
I no longer have 2 installed and would like to migrate everything to Python 3, but when use python in CLI it says "command not found", isn't that supposed to default to Python 3?
I'm a little confused on what the status of the migration from Python 2 to 3 is.
I no longer have 2 installed and would like to migrate everything to Python 3, but when use python in CLI it says "command not found", isn't that supposed to default to Python 3?
- sunrat
- Administrator
- Posts: 6477
- Joined: 2006-08-29 09:12
- Location: Melbourne, Australia
- Has thanked: 118 times
- Been thanked: 474 times
Re: Is Python3 now standard on Debian 11 Bullseye?
Post the command and error message exactly.
The command "python" should now be a symlink to "python3" Check:
The command "python" should now be a symlink to "python3" Check:
Code: Select all
$ file /usr/bin/python
/usr/bin/python: symbolic link to /usr/bin/python3
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
- ticojohn
- Posts: 1284
- Joined: 2009-08-29 18:10
- Location: Costa Rica
- Has thanked: 21 times
- Been thanked: 44 times
Re: Is Python3 now standard on Debian 11 Bullseye?
Hey there @sunrat, not being in any way critical because you're way smarter than I, but I just did that on my Bullseye installationsunrat wrote: ↑2021-09-30 05:07 Post the command and error message exactly.
The command "python" should now be a symlink to "python3" Check:Code: Select all
$ file /usr/bin/python /usr/bin/python: symbolic link to /usr/bin/python3
Code: Select all
$ file /usr/bin/python
/usr/bin/python: cannot open `/usr/bin/python' (No such file or directory)
Code: Select all
$ file /usr/bin/python3
/usr/bin/python3: symbolic link to python3.9
I am not irrational, I'm just quantum probabilistic.
- sunrat
- Administrator
- Posts: 6477
- Joined: 2006-08-29 09:12
- Location: Melbourne, Australia
- Has thanked: 118 times
- Been thanked: 474 times
Re: Is Python3 now standard on Debian 11 Bullseye?
I'm pretty sure I didn't create that symlink and its creation date is the same as most of the other python files in /usr/bin/ so think it was created by the installer. I do recall creating it in a previous install a long time ago and it actually enabled a couple of python2 programs to run under python3.ticojohn wrote: ↑2021-10-01 19:25Hey there @sunrat, not being in any way critical because you're way smarter than I, but I just did that on my Bullseye installationsunrat wrote: ↑2021-09-30 05:07 Post the command and error message exactly.
The command "python" should now be a symlink to "python3" Check:Code: Select all
$ file /usr/bin/python /usr/bin/python: symbolic link to /usr/bin/python3
However this worksCode: Select all
$ file /usr/bin/python /usr/bin/python: cannot open `/usr/bin/python' (No such file or directory)
Code: Select all
$ file /usr/bin/python3 /usr/bin/python3: symbolic link to python3.9
So just create it.
Code: Select all
ln -s python3 python
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Re: Is Python3 now standard on Debian 11 Bullseye?
I should probably elaborate on the subject line and clarify the question:
Do you need python 2.x installed for a Debian 11 Bullseye system to still work properly? If no, then python2.x has been transitioned to 3.
I don't seem to have 2.x installed and it seems to work properly.
So using the command python might be deprecated and obsolete and to not accidentally get the python2 interpreter, all calls are now made via python3.
I don't know if this assumption is correct, that is why I'm asking.
Do you need python 2.x installed for a Debian 11 Bullseye system to still work properly? If no, then python2.x has been transitioned to 3.
I don't seem to have 2.x installed and it seems to work properly.
So using the command python might be deprecated and obsolete and to not accidentally get the python2 interpreter, all calls are now made via python3.
I don't know if this assumption is correct, that is why I'm asking.
- craigevil
- Posts: 5391
- Joined: 2006-09-17 03:17
- Location: heaven
- Has thanked: 28 times
- Been thanked: 39 times
Re: Is Python3 now standard on Debian 11 Bullseye?
No you do not need python2.
Python3 is the default version of python on Bullseye.
Python3 is the default version of python on Bullseye.
Raspberry PI 400 Distro: Raspberry Pi OS Base: Debian Sid Kernel: 5.15.69-v8+ aarch64 DE: MATE Ram 4GB
Debian - "If you can't apt install something, it isn't useful or doesn't exist"
My Giant Sources.list
Debian - "If you can't apt install something, it isn't useful or doesn't exist"
My Giant Sources.list
Re: Is Python3 now standard on Debian 11 Bullseye?
If you want python to be a symlink to python3 you need to apt install python-is-python3.
It's all slightly messy, but from what I can tell there are no traces of python2 left (at least in my desktop installation here).Starting with the Debian 11 (bullseye) and Ubuntu 20.04 LTS (focal)
releases, all python packages use explicit python3 or python2
interpreter and do not use unversioned /usr/bin/python at all. Some
third-party code is now predominantly python3 based, yet may use
/usr/bin/python.
This is a convenience package which ships a symlink to point
the /usr/bin/python interpreter at the current default python3. It may
improve compatibility with other modern systems, whilst breaking some
obsolete or 3rd-party software.
- sunrat
- Administrator
- Posts: 6477
- Joined: 2006-08-29 09:12
- Location: Melbourne, Australia
- Has thanked: 118 times
- Been thanked: 474 times
Re: Is Python3 now standard on Debian 11 Bullseye?
That's what I posted above, except in a simple command rather than installing another package.reinob wrote: ↑2021-10-06 06:16 If you want python to be a symlink to python3 you need to apt install python-is-python3.
Starting with the Debian 11 (bullseye) and Ubuntu 20.04 LTS (focal)
releases, all python packages use explicit python3 or python2
interpreter and do not use unversioned /usr/bin/python at all. Some
third-party code is now predominantly python3 based, yet may use
/usr/bin/python.
This is a convenience package which ships a symlink to point
the /usr/bin/python interpreter at the current default python3. It may
improve compatibility with other modern systems, whilst breaking some
obsolete or 3rd-party software.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Re: Is Python3 now standard on Debian 11 Bullseye?
Yup, just wanted to clarify the reason for the missing /usr/bin/python.
Plus I'd recommend, generally, to do such things by installing the relevant package (if there is one) rather than by altering things in /usr/bin (as this might be overwritten by subsequent updates, etc.)
Re: Is Python3 now standard on Debian 11 Bullseye?
yes and that is why we have package manager: They setup the system consistently and managable.reinob wrote: ↑2021-10-06 07:05Yup, just wanted to clarify the reason for the missing /usr/bin/python.
Plus I'd recommend, generally, to do such things by installing the relevant package (if there is one) rather than by altering things in /usr/bin (as this might be overwritten by subsequent updates, etc.)