0

Firstly, I'm aware several questions and answers about the similar problem on stackexchange already; and I just want to get a more consistent understanding of my current situation.

When I checked

which -a python

I obtained the following information:

/Users/yangtong/anaconda2/bin/python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
/usr/local/bin/python
/usr/bin/python

which were installed by different ways at different time I completely forgot... I know this is stupid and crazy...

Now my questions are:

  1. which pythons listed above are system-bundled, and I should leave them alone? And which ones, e.g. the one in anaconda, can be safely uninstalled?

  2. I installed some external packages, probably, for each of them, so is there any way I can view all installed packages for each of these 4 pythons separately?

  3. Can I remove some of them safely and effectively? I wouldn't expect there is any way I can move installed packages of all different pythons into the one I want to keep, right?

antzshrek
  • 9,276
  • 5
  • 26
  • 43
Kite.Y
  • 103
  • 6

1 Answers1

0

(1) The system-bundled one is : /usr/bin/python

(2) If pip is install on each version of Python, you can do (for example) :

/Users/yangtong/anaconda2/bin/python pip freeze 

or (for /usr/bin/python)

/usr/bin/python

then

help("modules")

(3) You can still remove them, but I highly recommend you to create only virtual environment from now :)

piratefache
  • 1,308
  • 11
  • 17
  • Thanks a lot! But why removing them is always not recommended?? – Kite.Y Jan 23 '18 at 00:53
  • Hello again! You can find the answer here : https://stackoverflow.com/questions/14117945/too-many-different-python-versions-on-my-system-and-causing-problems?answertab=votes#tab-top – piratefache Jan 23 '18 at 01:03
  • For the Andoconda installed version you can type 'conda list' to get a list of modules installed in that environment. – Natsfan Jan 23 '18 at 01:13
  • 1
    Anaconda is very nice in that it makes it easy to create virtual environments. Virtual environments enabled me to run both python 2.13 and python 3.6 on my Mac. – Natsfan Jan 23 '18 at 01:17
  • @jmh Conda is the one I want to keep besides the system-bundled one, since I just noticed most of previous packages were integrated by Conda. Thx!! – Kite.Y Jan 23 '18 at 14:45
  • @MichaelCara Yeah I already knew the answer in that link. Just wondering, what about the one in "/Library/Frameworks/Python.framework/Versions/2.7/bin/python"? You said the system-bundled one is "/usr/bin/python", so this "Frameworks" has nothing to do with my system and can be safely removed, right? – Kite.Y Jan 23 '18 at 14:46
  • I am not sure. If you look at that link : https://stackoverflow.com/questions/30844746/how-to-uninstall-all-python-versions-and-use-the-default-system-version-of-os-x it says that one of those is a symlink to the other. Can't be sure exaclty which one it is because it depends of your os version. – piratefache Jan 23 '18 at 16:18