0

I am a new Linux user I just swapped over from Windows. Well rather I'm dual booting but plan to use Ubuntu as my primary OS from now on. I just installed Python 2.7.8 and in the thread that I read the instructions from the poster said that it was required that I install some dependencies. However, Python runs fine and I haven't installed anything else. I was wondering if this was just an older thing as the thread was installing Python 2.7.5 on an older version of Ubuntu (I am using 14.04 lts). I'll link the other thread below. If anyone can tell me why he installed the dependencies and if I need them that would be great. Thanks in advance for any help.

To clarify I was looking for anything that I needed to install before I could use Python 2.7.8 without issues, but this was before I learned that a version of Python shipped with Ubuntu. So I now have Python 2.7.8 and Python 3.4 (although my computer only shows Python 3.4 in the software center) as long as it is ok to have two different installs of different versions of Python without any drastic issues then I'm fine. I was just wondering if there was anything else that needed to be installed for them to work properly.

How do I install the latest Python 2.7.X or 3.X on Ubuntu?

  • 1
    Nothing in the question says anything about why the default version of python in Ubuntu (2.7.6, 3.4.0) won't work for you. – muru Sep 10 '14 at 02:47
  • @muru the link provided in the question is for building python from source and so there are dependencies listed, build essential etc. – mchid Sep 10 '14 at 03:16
  • @mchid My question is: Why is OP installing from source? Without that information, there's no answering the question. – muru Sep 10 '14 at 03:18
  • @Boomer697 you don't need those dependencies unless you want to build python from source. If you've installed python though ubuntu software-center or apt-get, the dependencies are resolved for you automatically. – mchid Sep 10 '14 at 03:18
  • @muru he installed python, then read the thread – mchid Sep 10 '14 at 03:19
  • @mchid Again: why? Python 2.7.6 is available and runs fine. Why is OP running around installing things from source? – muru Sep 10 '14 at 03:21
  • Sorry for not being clear. I am very new to Ubuntu and didn't know that it came with Python, what I did was followed the directions from the linked thread instead for Python 2.7.8. However, I didn't install the dependencies. Python seems to run fine but I wanted to ask if I was missing anything that would cause a problem in the future. If reinstalling Python 2.7.8 on a fresh install of Ubuntu 14.04 lts doesn't cause any odd problems then I'm fine. I was just wondering if there were any things I was missing. – Boomer697 Sep 10 '14 at 19:04
  • It is not only okay, but expected to have two Python versions in your Ubuntu, one 2.7.x and one 3.y.z (Ubuntu comes with 2.7.6 and 3.4.0 installed by default). It's a long story. If you do any programming with Python, stick to Python3. – muru Sep 12 '14 at 16:09

2 Answers2

1

Ubuntu and apt in general have a very cool feature called "Dependency Resolution."

Meaning, it will automatically install all required dependencies for you at the time of install. If it cannot, it will usually complain and the program will not work.

In your case, it sounds like everything installed and dependency resolution did its job right.

FFR, apt will always let you know if something is wrong. If it doesn't say something is wrong, it worked.

Kaz Wolfe
  • 34,122
  • 21
  • 114
  • 172
1

Python is installed by default with Ubuntu, so if you were "upgrading" from an older version to the most up to date (at the point in the linked question it appears to be 2.7.2) However currently 2.7.2 is not the most up to date version at this moment. Even for python 2.X, 2.7.8 was latest upgrade.

As a side note, depending on how much you are running python programs, you may wish to have both 2.X, and 3.X installed.(Where 'X' is whatever version number after dot) The reason for this is, the language has different semantics, and it is sometimes just easier to have both, versus editing code.


Other information:

From command line to run pre-3 python:

python filename.py

From command line to run python 3.X:

python3 filename.py

No Time
  • 1,073
  • 11
  • 25
  • Thank you for you input, at the time of installing Python I hadn't known that Ubuntu came with it already. Thanks for the tips too. – Boomer697 Sep 10 '14 at 19:05