user7600729
user7600729

Reputation:

Run Python 3.6 in Terminal on Mac?

I am using a Python on a Mac and I know that Python 2 comes preinstalled on the system (and in fact usable through Terminal). Is there a way to make it so Terminal can run Python 3? Can/should you set this as a default? I know changing the default settings for Python version usage could break your system so should I just install Python 3 and then use it through its launch icon instead?

Upvotes: 2

Views: 7222

Answers (5)

Shreyas Nagare
Shreyas Nagare

Reputation: 21

Package manager:

pip3 install something

Interpreter:

python3

Upvotes: 1

Teno Abba
Teno Abba

Reputation: 1

as usual in Mac python 2.7 is already installed, however if you installed python 3+ then you can just type in terminal: python3 so that you can use the newer version that you installed. if you want to use python 2.7 then just type: python

Upvotes: 0

Taku
Taku

Reputation: 33724

You can use python 3 in terminal after you have python 3 installed. Every time you run a command type python3 instead of python if you are using pip to install modules you can do this: But you must have pip installed for python 3

$ python3 -m pip install something

Upvotes: 0

Dror
Dror

Reputation: 13051

Best option is to install Python through Anaconda. This allows easy management and much more. You can have virtual environments having different Python versions as well as different modules installed.

Upvotes: 0

Yaman Jain
Yaman Jain

Reputation: 1247

Use can use python version management tool https://github.com/yyuu/pyenv

Upvotes: 1

Related Questions