0

I have a mac. When I do python -V : it shows python 2.75

I installed python 3. How do I use it as default?

When I do whereis python. It shows /usr/bin/python.

sebix
  • 2,943
  • 2
  • 28
  • 43
airnet
  • 2,565
  • 5
  • 31
  • 35
  • What do you get when you run `python3` instead? That's the command you should use if you want version 3. – tshepang Apr 24 '14 at 20:00
  • i typed whereis python3. And I get nothing – airnet Apr 24 '14 at 20:01
  • How did you install Python 3? – Wooble Apr 24 '14 at 20:02
  • Used the installer from https://www.python.org/download/ – airnet Apr 24 '14 at 20:03
  • but if i do python3 -V. it says python 3.4.0 – airnet Apr 24 '14 at 20:04
  • I would like my system to use python3 as default – airnet Apr 24 '14 at 20:06
  • 5
    you should not do that! Some of your system utils might use python 2, which will break them. You could use python brew to change your users version. I think you should give it a try. – scriptmonster Apr 24 '14 at 20:07
  • 1
    @scriptmonster Those system utils will probably use `#!/usr/bin/python2.7` explicitly, which nothing should ever overwrite. This is why `/usr/local/` is there in the first place. – millimoose Apr 24 '14 at 20:29
  • @airnet For use from the terminal, you just need to make sure that the directory that the symlink from `python` to `python3.2` is in comes first on PATH. My hunch is it's `/usr/local/bin/`, but I'm not sure, since I use Homebrew. – millimoose Apr 24 '14 at 20:31
  • @millimoose probably, but I would not try on my device. Good luck, those who are brave enough to test it. – scriptmonster Apr 24 '14 at 20:32
  • @scriptmonster Everyone who's ever used Macports or Homebrew Python did what I described above. Somehow, the world has not collapsed. In fact, it's the **recommended** way if you use Python for development. The idea is that you do not use system Python for development, you do not upgrade its libraries, you do not install new ones, and generally do not touch it at all – you "play around" in your private installation. System python is only there for those "system tools", and `.app`s that target a given OS X version and its built-in Python instead of embedding their own separate copy. – millimoose Apr 24 '14 at 20:41

0 Answers0