1

I have several two python on my mac, one is original, and another is downloaded on the website, when I open the python in terminal, how can I decide which I'm opening? Thanks for help.

Yunfei Lu
  • 389
  • 1
  • 5
  • 18

3 Answers3

1

Specify the full path to the binary.

$ some/path/to/python
 ...
>>>

Alternatively, create an alias to do so.

$ alias pythonx="some/path/to/python"
$ pythonx
 ...
>>>
Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
0

I would recomend you to use virtual environments. Since you isolate your development environment, you are free of guilt of breaking something that is using the default Python version. Also, you can use whatever version of Python you want just by calling python from the console, after activating the virtualenv for that project.

See http://docs.python-guide.org/en/latest/dev/virtualenvs/ in order to understand how to use it.

Here Use different Python version with virtualenv there is an explanation about how to change the Python's version for a specific environment.

Community
  • 1
  • 1
thyago stall
  • 1,654
  • 3
  • 16
  • 30
0

Also, if you just need to know which installation of Python is the system using, the way to do it is typing which python at the terminal.

hrishi
  • 413
  • 1
  • 4
  • 15