Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ubuntu 12.04 LTS: Update python 2.7.3 to 2.7.6 without breaking dependencies [closed]

So, I recently reinstalled Precise after encountering some swap issues. A friend and I were discussing working on something in Python together, so I checked my version. However, 12.04 comes with Python 2.7.3 installed. I wanted to update to 2.7.6, so I downloaded the tar for it. Then, I was silly enough to punch in sudo apt-get remove python without considering the dependency issues for my desktop. (My rationale was that I wanted to get rid of the old install.)

Long story short, I broke all of my Python dependencies, thus destroying Unity. I just finished re-installing Ubuntu again.

I tried following this tutorial, but

  1. make test had about a 50% failure rate (a separate concern in itself)
  2. When I entered

    make install && chmod -v 755 /usr/lib/libpython2.7.so.1.0

I got

/usr/bin/install -c python /usr/bin/python2.7
/usr/bin/install: cannot remove `/usr/bin/python2.7': Permission denied
make: *** [altbininstall] Error 1

I'm concerned, as a result, that running the command again as root would result in removing 2.7.3 all over again. I'm anything but a bash guru, so I don't have a good sense for what's going under the hood here. I'm just trying to get 2.7.6 at this point; I'm perfectly content with 2.7.3 staying on the machine if there are dependencies.

So, should I...

A. just run the command as root?

B. update Python some other way (and by "update" I really just mean get a clean install of 2.7.6)? If so, how?

like image 337
eenblam Avatar asked Dec 07 '13 19:12

eenblam


2 Answers

removing python from Ubuntu even temporarily will probably irreversibly crash your system.

for handling multiple versions of python and its libraries, check out python virtualenv or even better virtualenvwrapper

see a nice article here

like image 144
Guy Gavriely Avatar answered Sep 29 '22 10:09

Guy Gavriely


It's a "have your cake and eat it" problem:

  • Either you value the stability of Ubuntu 12.04 LTS,
  • or you value current versions.

I tend to upgrade every six months. There can be hybrids; maybe there is a PPA with "backported" newer Python your 12.04 version.

like image 21
Dirk Eddelbuettel Avatar answered Sep 29 '22 10:09

Dirk Eddelbuettel