linux - Clear remove of additional Python from usr/local/ on Ubuntu

07
2014-07
  • Andrei Kucharavy

    I need to use a machine at work (12.04 Ubuntu box) that has two versions of Python installed: the default 2.7.3 one from the /usr/bin and a 2.7.5 one that was installed into usr/local/bin. The isntallation wasn't clean, in the sense no alt-install was used and the python now redirects to the 2.7.5.

    I don't know how long it was there or what kind of python-dependent tools have been installed after over it. The problem is that pip was installed only for the 2.7.3, but tries to install into the 2.7.5 folders, making compilation of numpy or scipy impossible.

    What is the cleanest way of removing the 2.7.5 without breaking any dependencies or, in the worst case, redirecting them onto the 2.7.3?

  • Answers
  • shadotu

    to redirect python to 2.7.3 type in terminal

    sudo update-alternative --config python
    

    and then select the version of python most likely 3

    to remove pythn 2.7.5 use apt-get i.e

     sudo apt-get remove python2.7-5
    

    then run

    sudo  apt-get autoremove
    

    to remove any dependancies not needed


  • Related Question

    linux - Running a Python script from its icon in Ubuntu
  • Ram Rachum

    Let's say I have a Python script sitting in a folder I just opened with the graphical file manager in standard Ubuntu. What would be the quickest way to run it?


  • Related Answers
  • Mahmoud Hossam

    Maybe "properties -> set executable [x] ?

    while struggling with how to import JVC's weird .mod format to standard .mpeg...