How do I use python 3 on terminal Mac
15,552
Solution 1
Just type python3
where you would have typed python
.
For example open repl type python3
run app.py program with python3.6 type python3 app.py
Solution 2
type python3
on command window/ terminal window & press enter
for exit from python type quit()
& press enter
Author by
tomak
Updated on June 04, 2022Comments
-
tomak almost 2 years
When I run python someCode.py in my terminal, I am actually using python 2.7
I have installed python 3.6 on my Mac and would like to use it in terminal. how can I do that?
-
v.coder over 6 yearsUse
python3
while initiating command line. -
cs95 over 6 yearsYou should be able to just use
python3.6 script.py
. -
Mark Setchell over 6 yearsIf you installed it with homebrew, either use
/usr/local/bin/python3
or change your PATH withexport PATH=/usr/local/bin:$PATH
and then you can just usepython3
. Be sure to use/usr/local/bin/pip3
to install packages for that Python.
-