Why is Python 2.7 still the default Python version in Ubuntu?Youtube-dl: Python not found (18.04)Python script that runs in Windows throws “<string>” error in Ubuntupython 2.7 is still default though alias python=python3.4 is setInstall miniconda Python 2.7Ubuntu: Update Scipy-stack for Python 2.7Version Python 2.7.6 by default in Ubuntu

Joining lists with same elements

Talk interpreter

about to retire but not retired yet, employed but not working any more

Tex Quotes(UVa 272)

If someone uses the Command spell and says "drop", what happens?

Command "root" and "subcommands"

How does encoder decoder network works?

Ordering a list of integers

Handling Disruptive Student on the Autism Spectrum

How can I reorder triggered abilities in Arena?

Does Yeshayahu 43:10b / 43:13a imply HaShem was created?

Redacting URLs as an email-phishing preventative?

Photoshop: How can I change the layer type?

Breaker Mapping Questions

How many lines of code does the original TeX contain?

Removal of て in Japanese novels

Why do proofs of Bernoulli's equation assume that forces on opposite ends point in different directions?

"fF" letter combination seems to be typeset strangely or incorrectly

What are the occurences of total war in the Native Americans?

Are the players on the same team as the DM?

Why is the UK so keen to remove the "backstop" when their leadership seems to think that no border will be needed in Northern Ireland?

Why is there a difference between predicting on Validation set and Test set?

Limitations with dynamical systems vs. PDEs?

How do proponents of Sola Scriptura address the ministry of those Apostles who authored no parts of Scripture?



Why is Python 2.7 still the default Python version in Ubuntu?


Youtube-dl: Python not found (18.04)Python script that runs in Windows throws “<string>” error in Ubuntupython 2.7 is still default though alias python=python3.4 is setInstall miniconda Python 2.7Ubuntu: Update Scipy-stack for Python 2.7Version Python 2.7.6 by default in Ubuntu






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








24

















According to official documentation of Python, Python2.7 support will end near in future.




DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support




Why is Ubuntu not using Python3 as default in their upcoming version?



$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="19.04 (Disco Dingo)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 19.04"
VERSION_ID="19.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=disco
UBUNTU_CODENAME=disco




$ python
Python 2.7.16 (default, Apr 6 2019, 01:42:57)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.









share|improve this question





















  • 2





    You can install the python3.7 package. The problem is that within an ubuntu linux mint version there are sometimes still old softwares, so you have to install the newer packages manually.

    – enigma
    Aug 13 at 8:59






  • 8





    @enigma It's not a duplicate of that question because python3 is already installed on ラビナンダン's system by default so he has both python and python3 installed alongside each other.

    – karel
    Aug 13 at 9:09












  • Related: Python script that runs in Windows throws “<string>” error in Ubuntu

    – Eliah Kagan
    Aug 14 at 18:04

















24

















According to official documentation of Python, Python2.7 support will end near in future.




DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support




Why is Ubuntu not using Python3 as default in their upcoming version?



$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="19.04 (Disco Dingo)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 19.04"
VERSION_ID="19.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=disco
UBUNTU_CODENAME=disco




$ python
Python 2.7.16 (default, Apr 6 2019, 01:42:57)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.









share|improve this question





















  • 2





    You can install the python3.7 package. The problem is that within an ubuntu linux mint version there are sometimes still old softwares, so you have to install the newer packages manually.

    – enigma
    Aug 13 at 8:59






  • 8





    @enigma It's not a duplicate of that question because python3 is already installed on ラビナンダン's system by default so he has both python and python3 installed alongside each other.

    – karel
    Aug 13 at 9:09












  • Related: Python script that runs in Windows throws “<string>” error in Ubuntu

    – Eliah Kagan
    Aug 14 at 18:04













24












24








24


6








According to official documentation of Python, Python2.7 support will end near in future.




DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support




Why is Ubuntu not using Python3 as default in their upcoming version?



$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="19.04 (Disco Dingo)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 19.04"
VERSION_ID="19.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=disco
UBUNTU_CODENAME=disco




$ python
Python 2.7.16 (default, Apr 6 2019, 01:42:57)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.









share|improve this question


















According to official documentation of Python, Python2.7 support will end near in future.




DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support




Why is Ubuntu not using Python3 as default in their upcoming version?



$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="19.04 (Disco Dingo)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 19.04"
VERSION_ID="19.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=disco
UBUNTU_CODENAME=disco




$ python
Python 2.7.16 (default, Apr 6 2019, 01:42:57)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.






python release-management






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 13 at 9:26









Zanna

52.9k14 gold badges149 silver badges250 bronze badges




52.9k14 gold badges149 silver badges250 bronze badges










asked Aug 13 at 8:41









ラビナンダンラビナンダン

1312 silver badges7 bronze badges




1312 silver badges7 bronze badges










  • 2





    You can install the python3.7 package. The problem is that within an ubuntu linux mint version there are sometimes still old softwares, so you have to install the newer packages manually.

    – enigma
    Aug 13 at 8:59






  • 8





    @enigma It's not a duplicate of that question because python3 is already installed on ラビナンダン's system by default so he has both python and python3 installed alongside each other.

    – karel
    Aug 13 at 9:09












  • Related: Python script that runs in Windows throws “<string>” error in Ubuntu

    – Eliah Kagan
    Aug 14 at 18:04












  • 2





    You can install the python3.7 package. The problem is that within an ubuntu linux mint version there are sometimes still old softwares, so you have to install the newer packages manually.

    – enigma
    Aug 13 at 8:59






  • 8





    @enigma It's not a duplicate of that question because python3 is already installed on ラビナンダン's system by default so he has both python and python3 installed alongside each other.

    – karel
    Aug 13 at 9:09












  • Related: Python script that runs in Windows throws “<string>” error in Ubuntu

    – Eliah Kagan
    Aug 14 at 18:04







2




2





You can install the python3.7 package. The problem is that within an ubuntu linux mint version there are sometimes still old softwares, so you have to install the newer packages manually.

– enigma
Aug 13 at 8:59





You can install the python3.7 package. The problem is that within an ubuntu linux mint version there are sometimes still old softwares, so you have to install the newer packages manually.

– enigma
Aug 13 at 8:59




8




8





@enigma It's not a duplicate of that question because python3 is already installed on ラビナンダン's system by default so he has both python and python3 installed alongside each other.

– karel
Aug 13 at 9:09






@enigma It's not a duplicate of that question because python3 is already installed on ラビナンダン's system by default so he has both python and python3 installed alongside each other.

– karel
Aug 13 at 9:09














Related: Python script that runs in Windows throws “<string>” error in Ubuntu

– Eliah Kagan
Aug 14 at 18:04





Related: Python script that runs in Windows throws “<string>” error in Ubuntu

– Eliah Kagan
Aug 14 at 18:04










1 Answer
1






active

oldest

votes


















37















According to the release notes of Bionic Beaver:




Python 2 is no longer installed by default. Python 3 has been updated to 3.6. This is the last LTS release to include Python 2 in main.




And the above statement is true. Python 2 isn't installed by default in 18.04 and versions released after that. Ubuntu has already moved almost all of its projects from Python 2 to Python 3. For example, according to release notes of Disco Dingo:




Samba was updated to version 4.10.x, and one of the big changes here is python3 support. In Disco, samba and its dependencies are all python3 only now, with the exception of tdb. tdb still builds a python2 package, namely python-tdb, but all the others, including samba itself, are python3 only.




Moreover, even before the release of Ubuntu 18.04, Ubuntu/Canonical started asking developers to move to Python 3 because the end is near. From Python - Ubuntu Wiki:




All Ubuntu/Canonical driven development should be targeting Python 3 right now, and all new code should be Python 3-only. If you can't do this because of your dependency stack, let's talk.




It seems that on your system Python 2 was installed intentionally or may be as a dependency of some other package whose developer haven't moved to Python 3. You can check the packages which are dependent on Python 2 by running,



apt rdepends python


The reason why Python 2 is invoked when python is run lies in the one of the historical point of PEP 394 -- The "python" Command on Unix-Like Systems:




The python command should always invoke Python 2 (to prevent hard-to-diagnose errors when Python 2 code is run on Python 3).







share|improve this answer






















  • 12





    To clarify the final point, Python 3 is not backwards compatible with Python 2. That, and combined with the fact that Python 2 has more library support than Python 3, means that a large number of developers still have a direct dependency on Python 2. Python 3 has been out for a while now, but really it's the libraries that are the reason why Python 2 is still so strongly used, even though it shouldn't even be supported anymore (if I'm remembering correctly, official support ended in 2018). EDIT: official support ends in 2020.

    – searchengine27
    Aug 13 at 19:04







  • 7





    "... the fact that Python 2 has more library support than Python 3 ..." - Do you have a source for that? I rarely encounter libraries anymore that don't support Python 3, and in fact some are dropping support for Python 2! (For example, Django, a popular Python web framework, hasn't supported Python 2 for three releases.) Your statement made sense five years ago, but today I don't think you can make that sweeping generalization without backing it up with statistics.

    – marcelm
    Aug 14 at 8:50






  • 7





    @searchengine27 I don't think that library support factors into it. The backwards compatibility concern is that the world is awash with random scripts that start with #!/usr/bin/python or equivalent, which would break if python became python3, whereas random scripts that depend on Python 3 are more likely to start with #!/usr/bin/python3.

    – James_pic
    Aug 14 at 10:14






  • 1





    @searchengine27 A long time ago someone made a "Python3 wall of Shame" website that listed the most common dependencies and their python3 status (which at the time was abysmal). However it's been years now that it has been changed to Python 3 Wall of Superpowers since practically all common dependencies have been migrated and the few that weren't migrating are dead anyway (the website hasn't been updated since april 2018 since now basically everything is python3-able).

    – Giacomo Alzetta
    Aug 14 at 11:01







  • 4





    Just as an addition: the fact that the Python Software Foundation will stop maintaining Python 2 in 2020 does not mean that Canonical will stop maintaining Python 2 in 2020. In fact, the whole point of using a Linux distribution from a reputable vendor is that all packages in the distribution (for Debian/Ubuntu that means the "main" repository) will be maintained for the entire lifetime of the distribution release regardless of support status of the original upstream package. In other words, the Python 2 package in Ubuntu 19.04 will be maintained as long as Ubuntu 19.04 is.

    – Jörg W Mittag
    Aug 14 at 14:35













Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1165360%2fwhy-is-python-2-7-still-the-default-python-version-in-ubuntu%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









37















According to the release notes of Bionic Beaver:




Python 2 is no longer installed by default. Python 3 has been updated to 3.6. This is the last LTS release to include Python 2 in main.




And the above statement is true. Python 2 isn't installed by default in 18.04 and versions released after that. Ubuntu has already moved almost all of its projects from Python 2 to Python 3. For example, according to release notes of Disco Dingo:




Samba was updated to version 4.10.x, and one of the big changes here is python3 support. In Disco, samba and its dependencies are all python3 only now, with the exception of tdb. tdb still builds a python2 package, namely python-tdb, but all the others, including samba itself, are python3 only.




Moreover, even before the release of Ubuntu 18.04, Ubuntu/Canonical started asking developers to move to Python 3 because the end is near. From Python - Ubuntu Wiki:




All Ubuntu/Canonical driven development should be targeting Python 3 right now, and all new code should be Python 3-only. If you can't do this because of your dependency stack, let's talk.




It seems that on your system Python 2 was installed intentionally or may be as a dependency of some other package whose developer haven't moved to Python 3. You can check the packages which are dependent on Python 2 by running,



apt rdepends python


The reason why Python 2 is invoked when python is run lies in the one of the historical point of PEP 394 -- The "python" Command on Unix-Like Systems:




The python command should always invoke Python 2 (to prevent hard-to-diagnose errors when Python 2 code is run on Python 3).







share|improve this answer






















  • 12





    To clarify the final point, Python 3 is not backwards compatible with Python 2. That, and combined with the fact that Python 2 has more library support than Python 3, means that a large number of developers still have a direct dependency on Python 2. Python 3 has been out for a while now, but really it's the libraries that are the reason why Python 2 is still so strongly used, even though it shouldn't even be supported anymore (if I'm remembering correctly, official support ended in 2018). EDIT: official support ends in 2020.

    – searchengine27
    Aug 13 at 19:04







  • 7





    "... the fact that Python 2 has more library support than Python 3 ..." - Do you have a source for that? I rarely encounter libraries anymore that don't support Python 3, and in fact some are dropping support for Python 2! (For example, Django, a popular Python web framework, hasn't supported Python 2 for three releases.) Your statement made sense five years ago, but today I don't think you can make that sweeping generalization without backing it up with statistics.

    – marcelm
    Aug 14 at 8:50






  • 7





    @searchengine27 I don't think that library support factors into it. The backwards compatibility concern is that the world is awash with random scripts that start with #!/usr/bin/python or equivalent, which would break if python became python3, whereas random scripts that depend on Python 3 are more likely to start with #!/usr/bin/python3.

    – James_pic
    Aug 14 at 10:14






  • 1





    @searchengine27 A long time ago someone made a "Python3 wall of Shame" website that listed the most common dependencies and their python3 status (which at the time was abysmal). However it's been years now that it has been changed to Python 3 Wall of Superpowers since practically all common dependencies have been migrated and the few that weren't migrating are dead anyway (the website hasn't been updated since april 2018 since now basically everything is python3-able).

    – Giacomo Alzetta
    Aug 14 at 11:01







  • 4





    Just as an addition: the fact that the Python Software Foundation will stop maintaining Python 2 in 2020 does not mean that Canonical will stop maintaining Python 2 in 2020. In fact, the whole point of using a Linux distribution from a reputable vendor is that all packages in the distribution (for Debian/Ubuntu that means the "main" repository) will be maintained for the entire lifetime of the distribution release regardless of support status of the original upstream package. In other words, the Python 2 package in Ubuntu 19.04 will be maintained as long as Ubuntu 19.04 is.

    – Jörg W Mittag
    Aug 14 at 14:35















37















According to the release notes of Bionic Beaver:




Python 2 is no longer installed by default. Python 3 has been updated to 3.6. This is the last LTS release to include Python 2 in main.




And the above statement is true. Python 2 isn't installed by default in 18.04 and versions released after that. Ubuntu has already moved almost all of its projects from Python 2 to Python 3. For example, according to release notes of Disco Dingo:




Samba was updated to version 4.10.x, and one of the big changes here is python3 support. In Disco, samba and its dependencies are all python3 only now, with the exception of tdb. tdb still builds a python2 package, namely python-tdb, but all the others, including samba itself, are python3 only.




Moreover, even before the release of Ubuntu 18.04, Ubuntu/Canonical started asking developers to move to Python 3 because the end is near. From Python - Ubuntu Wiki:




All Ubuntu/Canonical driven development should be targeting Python 3 right now, and all new code should be Python 3-only. If you can't do this because of your dependency stack, let's talk.




It seems that on your system Python 2 was installed intentionally or may be as a dependency of some other package whose developer haven't moved to Python 3. You can check the packages which are dependent on Python 2 by running,



apt rdepends python


The reason why Python 2 is invoked when python is run lies in the one of the historical point of PEP 394 -- The "python" Command on Unix-Like Systems:




The python command should always invoke Python 2 (to prevent hard-to-diagnose errors when Python 2 code is run on Python 3).







share|improve this answer






















  • 12





    To clarify the final point, Python 3 is not backwards compatible with Python 2. That, and combined with the fact that Python 2 has more library support than Python 3, means that a large number of developers still have a direct dependency on Python 2. Python 3 has been out for a while now, but really it's the libraries that are the reason why Python 2 is still so strongly used, even though it shouldn't even be supported anymore (if I'm remembering correctly, official support ended in 2018). EDIT: official support ends in 2020.

    – searchengine27
    Aug 13 at 19:04







  • 7





    "... the fact that Python 2 has more library support than Python 3 ..." - Do you have a source for that? I rarely encounter libraries anymore that don't support Python 3, and in fact some are dropping support for Python 2! (For example, Django, a popular Python web framework, hasn't supported Python 2 for three releases.) Your statement made sense five years ago, but today I don't think you can make that sweeping generalization without backing it up with statistics.

    – marcelm
    Aug 14 at 8:50






  • 7





    @searchengine27 I don't think that library support factors into it. The backwards compatibility concern is that the world is awash with random scripts that start with #!/usr/bin/python or equivalent, which would break if python became python3, whereas random scripts that depend on Python 3 are more likely to start with #!/usr/bin/python3.

    – James_pic
    Aug 14 at 10:14






  • 1





    @searchengine27 A long time ago someone made a "Python3 wall of Shame" website that listed the most common dependencies and their python3 status (which at the time was abysmal). However it's been years now that it has been changed to Python 3 Wall of Superpowers since practically all common dependencies have been migrated and the few that weren't migrating are dead anyway (the website hasn't been updated since april 2018 since now basically everything is python3-able).

    – Giacomo Alzetta
    Aug 14 at 11:01







  • 4





    Just as an addition: the fact that the Python Software Foundation will stop maintaining Python 2 in 2020 does not mean that Canonical will stop maintaining Python 2 in 2020. In fact, the whole point of using a Linux distribution from a reputable vendor is that all packages in the distribution (for Debian/Ubuntu that means the "main" repository) will be maintained for the entire lifetime of the distribution release regardless of support status of the original upstream package. In other words, the Python 2 package in Ubuntu 19.04 will be maintained as long as Ubuntu 19.04 is.

    – Jörg W Mittag
    Aug 14 at 14:35













37














37










37









According to the release notes of Bionic Beaver:




Python 2 is no longer installed by default. Python 3 has been updated to 3.6. This is the last LTS release to include Python 2 in main.




And the above statement is true. Python 2 isn't installed by default in 18.04 and versions released after that. Ubuntu has already moved almost all of its projects from Python 2 to Python 3. For example, according to release notes of Disco Dingo:




Samba was updated to version 4.10.x, and one of the big changes here is python3 support. In Disco, samba and its dependencies are all python3 only now, with the exception of tdb. tdb still builds a python2 package, namely python-tdb, but all the others, including samba itself, are python3 only.




Moreover, even before the release of Ubuntu 18.04, Ubuntu/Canonical started asking developers to move to Python 3 because the end is near. From Python - Ubuntu Wiki:




All Ubuntu/Canonical driven development should be targeting Python 3 right now, and all new code should be Python 3-only. If you can't do this because of your dependency stack, let's talk.




It seems that on your system Python 2 was installed intentionally or may be as a dependency of some other package whose developer haven't moved to Python 3. You can check the packages which are dependent on Python 2 by running,



apt rdepends python


The reason why Python 2 is invoked when python is run lies in the one of the historical point of PEP 394 -- The "python" Command on Unix-Like Systems:




The python command should always invoke Python 2 (to prevent hard-to-diagnose errors when Python 2 code is run on Python 3).







share|improve this answer















According to the release notes of Bionic Beaver:




Python 2 is no longer installed by default. Python 3 has been updated to 3.6. This is the last LTS release to include Python 2 in main.




And the above statement is true. Python 2 isn't installed by default in 18.04 and versions released after that. Ubuntu has already moved almost all of its projects from Python 2 to Python 3. For example, according to release notes of Disco Dingo:




Samba was updated to version 4.10.x, and one of the big changes here is python3 support. In Disco, samba and its dependencies are all python3 only now, with the exception of tdb. tdb still builds a python2 package, namely python-tdb, but all the others, including samba itself, are python3 only.




Moreover, even before the release of Ubuntu 18.04, Ubuntu/Canonical started asking developers to move to Python 3 because the end is near. From Python - Ubuntu Wiki:




All Ubuntu/Canonical driven development should be targeting Python 3 right now, and all new code should be Python 3-only. If you can't do this because of your dependency stack, let's talk.




It seems that on your system Python 2 was installed intentionally or may be as a dependency of some other package whose developer haven't moved to Python 3. You can check the packages which are dependent on Python 2 by running,



apt rdepends python


The reason why Python 2 is invoked when python is run lies in the one of the historical point of PEP 394 -- The "python" Command on Unix-Like Systems:




The python command should always invoke Python 2 (to prevent hard-to-diagnose errors when Python 2 code is run on Python 3).








share|improve this answer














share|improve this answer



share|improve this answer








edited Aug 19 at 19:10

























answered Aug 13 at 8:56









KulfyKulfy

7,49710 gold badges31 silver badges58 bronze badges




7,49710 gold badges31 silver badges58 bronze badges










  • 12





    To clarify the final point, Python 3 is not backwards compatible with Python 2. That, and combined with the fact that Python 2 has more library support than Python 3, means that a large number of developers still have a direct dependency on Python 2. Python 3 has been out for a while now, but really it's the libraries that are the reason why Python 2 is still so strongly used, even though it shouldn't even be supported anymore (if I'm remembering correctly, official support ended in 2018). EDIT: official support ends in 2020.

    – searchengine27
    Aug 13 at 19:04







  • 7





    "... the fact that Python 2 has more library support than Python 3 ..." - Do you have a source for that? I rarely encounter libraries anymore that don't support Python 3, and in fact some are dropping support for Python 2! (For example, Django, a popular Python web framework, hasn't supported Python 2 for three releases.) Your statement made sense five years ago, but today I don't think you can make that sweeping generalization without backing it up with statistics.

    – marcelm
    Aug 14 at 8:50






  • 7





    @searchengine27 I don't think that library support factors into it. The backwards compatibility concern is that the world is awash with random scripts that start with #!/usr/bin/python or equivalent, which would break if python became python3, whereas random scripts that depend on Python 3 are more likely to start with #!/usr/bin/python3.

    – James_pic
    Aug 14 at 10:14






  • 1





    @searchengine27 A long time ago someone made a "Python3 wall of Shame" website that listed the most common dependencies and their python3 status (which at the time was abysmal). However it's been years now that it has been changed to Python 3 Wall of Superpowers since practically all common dependencies have been migrated and the few that weren't migrating are dead anyway (the website hasn't been updated since april 2018 since now basically everything is python3-able).

    – Giacomo Alzetta
    Aug 14 at 11:01







  • 4





    Just as an addition: the fact that the Python Software Foundation will stop maintaining Python 2 in 2020 does not mean that Canonical will stop maintaining Python 2 in 2020. In fact, the whole point of using a Linux distribution from a reputable vendor is that all packages in the distribution (for Debian/Ubuntu that means the "main" repository) will be maintained for the entire lifetime of the distribution release regardless of support status of the original upstream package. In other words, the Python 2 package in Ubuntu 19.04 will be maintained as long as Ubuntu 19.04 is.

    – Jörg W Mittag
    Aug 14 at 14:35












  • 12





    To clarify the final point, Python 3 is not backwards compatible with Python 2. That, and combined with the fact that Python 2 has more library support than Python 3, means that a large number of developers still have a direct dependency on Python 2. Python 3 has been out for a while now, but really it's the libraries that are the reason why Python 2 is still so strongly used, even though it shouldn't even be supported anymore (if I'm remembering correctly, official support ended in 2018). EDIT: official support ends in 2020.

    – searchengine27
    Aug 13 at 19:04







  • 7





    "... the fact that Python 2 has more library support than Python 3 ..." - Do you have a source for that? I rarely encounter libraries anymore that don't support Python 3, and in fact some are dropping support for Python 2! (For example, Django, a popular Python web framework, hasn't supported Python 2 for three releases.) Your statement made sense five years ago, but today I don't think you can make that sweeping generalization without backing it up with statistics.

    – marcelm
    Aug 14 at 8:50






  • 7





    @searchengine27 I don't think that library support factors into it. The backwards compatibility concern is that the world is awash with random scripts that start with #!/usr/bin/python or equivalent, which would break if python became python3, whereas random scripts that depend on Python 3 are more likely to start with #!/usr/bin/python3.

    – James_pic
    Aug 14 at 10:14






  • 1





    @searchengine27 A long time ago someone made a "Python3 wall of Shame" website that listed the most common dependencies and their python3 status (which at the time was abysmal). However it's been years now that it has been changed to Python 3 Wall of Superpowers since practically all common dependencies have been migrated and the few that weren't migrating are dead anyway (the website hasn't been updated since april 2018 since now basically everything is python3-able).

    – Giacomo Alzetta
    Aug 14 at 11:01







  • 4





    Just as an addition: the fact that the Python Software Foundation will stop maintaining Python 2 in 2020 does not mean that Canonical will stop maintaining Python 2 in 2020. In fact, the whole point of using a Linux distribution from a reputable vendor is that all packages in the distribution (for Debian/Ubuntu that means the "main" repository) will be maintained for the entire lifetime of the distribution release regardless of support status of the original upstream package. In other words, the Python 2 package in Ubuntu 19.04 will be maintained as long as Ubuntu 19.04 is.

    – Jörg W Mittag
    Aug 14 at 14:35







12




12





To clarify the final point, Python 3 is not backwards compatible with Python 2. That, and combined with the fact that Python 2 has more library support than Python 3, means that a large number of developers still have a direct dependency on Python 2. Python 3 has been out for a while now, but really it's the libraries that are the reason why Python 2 is still so strongly used, even though it shouldn't even be supported anymore (if I'm remembering correctly, official support ended in 2018). EDIT: official support ends in 2020.

– searchengine27
Aug 13 at 19:04






To clarify the final point, Python 3 is not backwards compatible with Python 2. That, and combined with the fact that Python 2 has more library support than Python 3, means that a large number of developers still have a direct dependency on Python 2. Python 3 has been out for a while now, but really it's the libraries that are the reason why Python 2 is still so strongly used, even though it shouldn't even be supported anymore (if I'm remembering correctly, official support ended in 2018). EDIT: official support ends in 2020.

– searchengine27
Aug 13 at 19:04





7




7





"... the fact that Python 2 has more library support than Python 3 ..." - Do you have a source for that? I rarely encounter libraries anymore that don't support Python 3, and in fact some are dropping support for Python 2! (For example, Django, a popular Python web framework, hasn't supported Python 2 for three releases.) Your statement made sense five years ago, but today I don't think you can make that sweeping generalization without backing it up with statistics.

– marcelm
Aug 14 at 8:50





"... the fact that Python 2 has more library support than Python 3 ..." - Do you have a source for that? I rarely encounter libraries anymore that don't support Python 3, and in fact some are dropping support for Python 2! (For example, Django, a popular Python web framework, hasn't supported Python 2 for three releases.) Your statement made sense five years ago, but today I don't think you can make that sweeping generalization without backing it up with statistics.

– marcelm
Aug 14 at 8:50




7




7





@searchengine27 I don't think that library support factors into it. The backwards compatibility concern is that the world is awash with random scripts that start with #!/usr/bin/python or equivalent, which would break if python became python3, whereas random scripts that depend on Python 3 are more likely to start with #!/usr/bin/python3.

– James_pic
Aug 14 at 10:14





@searchengine27 I don't think that library support factors into it. The backwards compatibility concern is that the world is awash with random scripts that start with #!/usr/bin/python or equivalent, which would break if python became python3, whereas random scripts that depend on Python 3 are more likely to start with #!/usr/bin/python3.

– James_pic
Aug 14 at 10:14




1




1





@searchengine27 A long time ago someone made a "Python3 wall of Shame" website that listed the most common dependencies and their python3 status (which at the time was abysmal). However it's been years now that it has been changed to Python 3 Wall of Superpowers since practically all common dependencies have been migrated and the few that weren't migrating are dead anyway (the website hasn't been updated since april 2018 since now basically everything is python3-able).

– Giacomo Alzetta
Aug 14 at 11:01






@searchengine27 A long time ago someone made a "Python3 wall of Shame" website that listed the most common dependencies and their python3 status (which at the time was abysmal). However it's been years now that it has been changed to Python 3 Wall of Superpowers since practically all common dependencies have been migrated and the few that weren't migrating are dead anyway (the website hasn't been updated since april 2018 since now basically everything is python3-able).

– Giacomo Alzetta
Aug 14 at 11:01





4




4





Just as an addition: the fact that the Python Software Foundation will stop maintaining Python 2 in 2020 does not mean that Canonical will stop maintaining Python 2 in 2020. In fact, the whole point of using a Linux distribution from a reputable vendor is that all packages in the distribution (for Debian/Ubuntu that means the "main" repository) will be maintained for the entire lifetime of the distribution release regardless of support status of the original upstream package. In other words, the Python 2 package in Ubuntu 19.04 will be maintained as long as Ubuntu 19.04 is.

– Jörg W Mittag
Aug 14 at 14:35





Just as an addition: the fact that the Python Software Foundation will stop maintaining Python 2 in 2020 does not mean that Canonical will stop maintaining Python 2 in 2020. In fact, the whole point of using a Linux distribution from a reputable vendor is that all packages in the distribution (for Debian/Ubuntu that means the "main" repository) will be maintained for the entire lifetime of the distribution release regardless of support status of the original upstream package. In other words, the Python 2 package in Ubuntu 19.04 will be maintained as long as Ubuntu 19.04 is.

– Jörg W Mittag
Aug 14 at 14:35

















draft saved

draft discarded
















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1165360%2fwhy-is-python-2-7-still-the-default-python-version-in-ubuntu%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?