0

I am using MacOS Sierra.

For some reason, I have different Python versions under different path names. These are the directories in my root folder

enter image description here

Under /System, I have 2 versions (2.3 & 2.5 symlinks to -> 2.6):

$ ls System/Library/Frameworks/Python.framework/Versions/
2.3 2.5 2.6 2.7 Current

Under /Library, 3 versions (7.3 is a misnamed 2.7):

$ ls Library/Frameworks/Python.framework/Versions/
2.7 3.2 7.3 Current

Under /Users, 1 versions:

$ ls Users/mySelf/Library/Python/
3.2

I need to install python 3.4 but I am not sure where it should go.

XY6
  • 3,082
  • 4
  • 21
  • 26
  • 1
    Under /System, 2.3 and 2.5 are symlinks to 2.6. – Josh Lee Feb 08 '17 at 02:23
  • Just corrected it. – XY6 Feb 08 '17 at 02:31
  • 3
    I highly recommend that you don't install Python directly, but that you use a package manager such as Homebrew, Fink, MacPorts, Alt portage, or whatever. Sidestep the problem of deciding where to put a manually-installed Python, and also enable yourself to have a cleanly managed system. – kojiro Feb 08 '17 at 02:40
  • Thanks for the recommendation. – XY6 Feb 08 '17 at 02:54
  • 1
    Even better use pyenv this is Python's RVM it lets you install and manage multiple python versions. – Vlad Feb 08 '17 at 03:00

1 Answers1

0

So Mac is a pain to install stuff on sometimes. Luckily for us, there is something called Homebrew! Homebrew is a package manager that is useful for installing many things that would otherwise be troublesome. It will even tell you where things go wrong and how to fix them (or at least start fixing them).

There is an installation guide here or here that you can follow. Happy coding :)

Edit 1: As to why you have multiple python versions installed, firstly mac comes with python 2.7 installed out of the box. Secondly, you may have installed another version of python at some point by accident (whether another program did it for you or it was done directly by you). You may need to go through the process of filtering out the ones you don't have any dependencies on and just delete them.

Edit 2: It is also worth mentioning that since El Capitan, apple introduced System Integrity Protection which caused problems for many installations by locking users out of the default installation folders for packages such as python or latex. Homebrew will get you around most of this without a problem, and keep track of your installations (if installed through homebrew).

Edit 3: As to why there are many paths for python available it is very closely linked to how you installed python pPackage installer, macports, homebrew all install in different locations, hence you would have a different path for each. You would probably have a few conflicting installations too.

Community
  • 1
  • 1
NineTails
  • 550
  • 4
  • 24
  • I know there can be multiple version. I want to know why they are under different paths. – XY6 Feb 08 '17 at 04:28
  • Thanks for the guides! – XY6 Feb 08 '17 at 04:48
  • See http://stackoverflow.com/a/14174029/5434676 - it will tell you exactly why. I'll put it in my answer above, then if you feel okay with it maybe choose it as the accepted answer? ;) – NineTails Feb 08 '17 at 05:12