LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-30-2017, 12:45 PM   #1
grumpyskeptic
Member
 
Registered: Apr 2016
Posts: 341

Rep: Reputation: Disabled
Updating Python to a newer version - easy or too difficult?


I have Linux Mint 17.3 Rosa Cinnamon. Python is not present in the program menu but typing python in the console evokes Python 2.7.6.

Is there any easy way to update Python to version 3, or is it too complicated to be worthwhile? Some quick reading on the internet suggests that Python might be deeply embedded in Linux Mint, making it too difficult to update.

I've started reading a guide to Python that uses version 3 so it would be good to have the same version on the computer, but perhaps the differences between v3 and v2.7.6 are not worth worrying about. I installed IDLE a few minutes ago, and as far as I can tell it is working OK.

I'm a little disappointed that the Software Manager in Linux Mint 17.3 very often only has an old version of software available to install, but mustnít look a gift-horse in the mouth as they say.

Thanks.
 
Old 04-30-2017, 01:29 PM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 17,243
Blog Entries: 10

Rep: Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160
well then you should dist-upgrade to 18.

but, on topic:
on archlinux it is possible to have python2 AND python3 installed. i don't think it's an arch-specific thing.
you should investigate that avenue for linux mint / ubuntu.
 
Old 04-30-2017, 02:33 PM   #3
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917
You should have both Python 2 and Python 3 installed on your computer.

dpkg -l 'python' will show you which version of Python 2 you have installed.

dpkg -l 'python3' will show you the Python 3 version.
 
Old 04-30-2017, 02:39 PM   #4
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917
I don't know how you installed Idle, but you should use:

sudo apt-get install idle-python3.5 python3-setuptools (the latter is required for installing some libraries).

Then run Idle with idle-python3.5

From then on, do all your work on Python 3. My advice would be to leave Python 2 well alone (some of the system depends on it).
 
Old 05-01-2017, 09:31 AM   #5
grumpyskeptic
Member
 
Registered: Apr 2016
Posts: 341

Original Poster
Rep: Reputation: Disabled
Thanks, I tried Hydrurgas suggestion of typing the magic spell dpkg -l 'python3' into the console and what resulted made it seem likely that Python 3.4 was indeed installed. So I uninstalled IDLE 2.7, and then uninstalled the generic version of IDLE, and then installed IDLE 3.4, and it appears to work OK and indicates that it is, or is using, Python 3.4.
 
Old 05-01-2017, 09:53 AM   #6
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917
Quote:
Originally Posted by grumpyskeptic View Post
Thanks, I tried Hydrurgas suggestion of typing the magic spell dpkg -l 'python3' into the console and what resulted made it seem likely that Python 3.4 was indeed installed. So I uninstalled IDLE 2.7, and then uninstalled the generic version of IDLE, and then installed IDLE 3.4, and it appears to work OK and indicates that it is, or is using, Python 3.4.
No! That was a potentially bad mistake. I advised you to leave both Python 2 and Python 3 installed (they can both live independently of each other). Some system functionality depends on Python 2 being present. I just hope you haven't borked your system.
 
Old 05-01-2017, 10:33 AM   #7
grumpyskeptic
Member
 
Registered: Apr 2016
Posts: 341

Original Poster
Rep: Reputation: Disabled
I had only installed IDLE very recently, so uninstalling it shouldn't be a problem. And I presume that the Software Manager in Mint is designed to prevent you from doing anything bad. Typing "python" in the console still tells me that python 2.7.6 is there, same as it was previously before I made any changes.
 
Old 05-01-2017, 10:42 AM   #8
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917
Quote:
Originally Posted by grumpyskeptic View Post
I had only installed IDLE very recently, so uninstalling it shouldn't be a problem. And I presume that the Software Manager in Mint is designed to prevent you from doing anything bad. Typing "python" in the console still tells me that python 2.7.6 is there, same as it was previously before I made any changes.
Oops, my mistake. I read "Python" for "Idle". As you were, with my sincere apologies...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Have newer python, but an app requires older python postcd Linux - General 2 05-05-2014 12:35 AM
Updating version for the python thangappan Linux - Newbie 4 09-08-2009 12:46 AM
installing a newer version of python arnon Linux - Software 3 01-04-2007 01:17 PM
Upgrading Python to newer version dopper Linux - Software 3 02-19-2004 12:10 PM
Xfree prob radeon.o kernel module version is 1.1.1 but version 1.5.0 or newer needed. jimdaworm Slackware 0 10-01-2003 06:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration