1

I have many installations of Python which I have installed via pip, dmg so on.. I want to delete all of them except one.

Need some guidance on finding the different installations and removing them.

Read this:

Too many different Python versions on my system and causing problems

But there weren't any specific solutions besides full-OS re-installation.. I don't want to do full-OS re-installation. Any suggestions how to go about cleaning up. Sorry if the question is too broad.

Edit:

Cs-MacBook-Pro-2:~ lakesh$ which python
/opt/local/bin/python
Cs-MacBook-Pro-2:~ lakesh$ which python2
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2
Cs-MacBook-Pro-2:~ lakesh$ which python3
/usr/local/bin/python3
Community
  • 1
  • 1
lakshmen
  • 28,346
  • 66
  • 178
  • 276
  • 1
    Try "which python", "which python2", "which python3" on the commandline. That should tell you where the one that is currently active is located. (And, after you uninstall it, that should tell you where the next one is located after that). – Michael Aaron Safyan Aug 31 '14 at 09:00
  • @MichaelAaronSafyan how to uninstall python? – lakshmen Aug 31 '14 at 09:04
  • Based on the location, you can look up the corresponding tool and delete accordingly. For example, "/opt/local" was probably installed with MacPorts or some other tool... find the documentation for that and uninstall accordingly. For "/usr/local/bin", it was probably installed manually... you'll probably want to find all the associated files and just delete them. Leave the system framework versions alone and intact. – Michael Aaron Safyan Aug 31 '14 at 09:06

1 Answers1

1

Use this commands:

python3 --version #shows the version of your python3 if exist 

python2 --version #shows the version of your python2 if exist 

python --version # shows which version in in use by default 

then for uninstall one of them you must follow the below steps :

for example for uninstall python2.7

1.remove the Python 2.7 framework

sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7

2.remove the Python 2.7 applications directory

sudo rm -rf "/Applications/Python 2.7"
  1. remove the symbolic links in /usr/local/bin that point to this python version see ls -l /usr/local/bin
Mazdak
  • 105,000
  • 18
  • 159
  • 188