Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 How to upgrade Python version in Ubuntu?, from 2.7 to 3.7?

views
     
TSk town shit
post Apr 7 2020, 12:33 PM, updated 4y ago

Enthusiast
*****
Junior Member
758 posts

Joined: Jan 2009
Hi all,

I tried:
CODE
sudo apt-get update python


Somehow, it returns:
QUOTE
E: The update command takes no arguments
Any idea?

PS: The Python is currently in used by the ERP. But this is a testing environment only in my machine. It doesn't really matter even if it's crash.
TruboXL
post Apr 7 2020, 12:37 PM

Over 900 useless posts
*****
Junior Member
984 posts

Joined: Jan 2016


python is for python 2.7
install python3 instead
malleus
post Apr 7 2020, 01:22 PM

Look at all my stars!!
*******
Senior Member
2,096 posts

Joined: Dec 2011
its apt-get upgrade to do the actual upgrade. update is only to refresh the package list
TSk town shit
post Apr 7 2020, 01:49 PM

Enthusiast
*****
Junior Member
758 posts

Joined: Jan 2009
QUOTE(malleus @ Apr 7 2020, 12:22 PM)
its apt-get upgrade to do the actual upgrade. update is only to refresh the package list
*
I tried this:
CODE
sudo apt-get upgrade python


But it shows this:
QUOTE
python is already the newest version (2.7.16-1).
python set to manually installed.
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
I just can't get it (Python) upgrade to version 3.7
ANy idea bro?
malleus
post Apr 7 2020, 01:58 PM

Look at all my stars!!
*******
Senior Member
2,096 posts

Joined: Dec 2011
QUOTE(k town shit @ Apr 7 2020, 01:49 PM)
I tried this:
CODE
sudo apt-get upgrade python


But it shows this:
I just can't get it (Python) upgrade to version 3.7
ANy idea bro?
*
What it looks like is the package named as python only has the versions 2.x.

try doing a package search for python packages and see what you get

apt-cache search python

that will give you the list of python packages, see if there's a python 3.7 in that list or not.

If not then you may need to add a 3rd party repository to get the python 3.7 package. Example here: http://ubuntuhandbook.org/index.php/2019/0...7-ubuntu-18-04/


jackoats.my
post Apr 15 2020, 04:50 PM

Getting Started
**
Junior Member
122 posts

Joined: Oct 2019
Does the latest version of Ubuntu Linux comes with Python 3? If you have not done a lot of work with your Ubuntu, you can try the new one.

If you still insist on using your current version of Ubuntu, all you need to do is to google it.


QUOTE(k town shit @ Apr 7 2020, 12:33 PM)
Hi all,

I tried:
CODE
sudo apt-get update python


Somehow, it returns:
Any idea?

PS: The Python is currently in used by the ERP. But this is a testing environment only in my machine. It doesn't really matter even if it's crash.
*
jackoats.my
post Apr 15 2020, 05:02 PM

Getting Started
**
Junior Member
122 posts

Joined: Oct 2019
If you need to run multiple versions of Linux, sign up for Google Cloud at no cost and create a few VMs. All you need is a Gmail account. Head to https://console.cloud.google.com. New user is given USD 300 credit for cloud use for upto a year.

There is another offer going on now (ending 30 Apr 2020)
1. Free 30 days on demand training on Google Cloud
2. Free 30 days hands-on labs

Check them out at https://cloud.google.com/blog/topics/traini...t-home-learning


QUOTE(k town shit @ Apr 7 2020, 12:33 PM)
Hi all,

I tried:
CODE
sudo apt-get update python


Somehow, it returns:
Any idea?

PS: The Python is currently in used by the ERP. But this is a testing environment only in my machine. It doesn't really matter even if it's crash.
*
bellfreedom
post Apr 19 2020, 02:17 AM

New Member
*
Newbie
37 posts

Joined: Oct 2015


you simply install brand new python3. the python2.7 is not advisble to remove due to it might have dependency with other application in your linux machine.

hotfloppy
post Jun 8 2020, 11:09 PM

Getting Started
**
Junior Member
95 posts

Joined: Oct 2004
From: Baker Street, NW


QUOTE(k town shit @ Apr 7 2020, 12:33 PM)
Hi all,

I tried:
CODE
sudo apt-get update python


Somehow, it returns:
Any idea?

PS: The Python is currently in used by the ERP. But this is a testing environment only in my machine. It doesn't really matter even if it's crash.
*
Not sure if you've already found a way to get Python 3.7 installed, but if you're still trying to figure it out, try this:

CODE
$ sudo apt install python3.7

In 18.04 (which I use right now), there's 4 versions of Python3:

CODE
user@box:~$ apt-cache policy python3 python3.6 python3.7 python3.8
python3:
 Installed: 3.6.7-1~18.04
 Candidate: 3.6.7-1~18.04
 Version table:
*** 3.6.7-1~18.04 500
       500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
       100 /var/lib/dpkg/status
    3.6.5-3 500
       500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages

python3.6:
 Installed: 3.6.9-1~18.04ubuntu1
 Candidate: 3.6.9-1~18.04ubuntu1
 Version table:
*** 3.6.9-1~18.04ubuntu1 500
       500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
       500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
       100 /var/lib/dpkg/status
    3.6.5-3 500
       500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages

python3.7:
 Installed: (none)
 Candidate: 3.7.5-2~18.04
 Version table:
    3.7.5-2~18.04 500
       500 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages
    3.7.3-2~18.04.1 500
       500 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages
    3.7.0~b3-1 500
       500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages

python3.8:
 Installed: (none)
 Candidate: 3.8.0-3~18.04
 Version table:
    3.8.0-3~18.04 500
       500 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages

Both Python2 and Python3 can be installed in the same system as their binary name is different.

CODE
user@box:~$ python -V; python2 -V; python3 -V
Python 2.7.17
Python 2.7.17
Python 3.6.9
user@box:~$ ls -l /usr/bin/python; ls -l /usr/bin/python2; ls -l /usr/bin/python3
lrwxrwxrwx 1 root root 9 Apr 16  2018 /usr/bin/python -> python2.7
lrwxrwxrwx 1 root root 9 Apr 16  2018 /usr/bin/python2 -> python2.7
lrwxrwxrwx 1 root root 9 Oct 25  2018 /usr/bin/python3 -> python3.6
user@box:~$


 

Change to:
| Lo-Fi Version
0.0154sec    0.23    5 queries    GZIP Disabled
Time is now: 29th March 2024 - 01:44 PM