4

I'm trying to figure out what version of python i have installed, and also upgrade it to the latest.

When I go to a command prompt and check, it looks like I have an old version of python installed.

me@linuxdev:~$ python
Python 2.7.8 (default, Oct 20 2014, 15:05:19) 
[GCC 4.9.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 

But then when i launch the sofware center in Ubuntu and check the "installed" section, under "developer tools" i see an entry for "Python (v3.4)"

So I'm not really sure what version I'm running. I would like to

  1. remove any old unused version of python.
  2. end up with one version, which should be the latest

Thanks.

EDIT 1

This is what happens when I try to reinstall python from the commandline:

me@linuxdev:~$ sudo apt-get --reinstall python
E: Command line option --reinstall is not understood
2
  • @Sachin Kamath - i'm getting the error "command line option --reinstall is not understood"
    – dot
    Jan 12, 2015 at 20:17
  • @Sachin Kamath: There's no point in reinstalling the python package here. Jan 12, 2015 at 20:21

2 Answers 2

10

Ubuntu 14.10 comes with Python 2.7.8 (available as python, python2 and python2.7) and Python 3.4.2 (available as python3 and python3.4) installed by default.

As many programs depend on them you can't remove any of them without breaking your system.

3
  • 2
    ok so i was just launching the wrong program from the commandline...? I should do python3 is what I'm hearing. Is that correct?
    – dot
    Jan 12, 2015 at 20:22
  • 2
    Yes. And for a script you use #!/usr/bin/python3 as shebang line. Jan 12, 2015 at 20:26
  • Note that Ubuntu 14.10 end of life was July 23, 2015 wiki.ubuntu.com/Releases
    – Ida N
    Nov 16, 2016 at 0:16
-2

To install or update python just type this in Terminal:

sudo apt-get install python

That's it :)

1
  • 2
    Welcome to Ask Ubuntu, nice to see you sharing knowledge. However, the original post asking about python3 and it already got a working answer. You instruction will update python2
    – user.dz
    Feb 5, 2016 at 10:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .