0

By default, I know MAC uses the python version 2.7.10. I have python 3.7 installed. I became sure of it by typing

python3 --version

in terminal which shows 3.7.2.

I want to use python's secret module which is available for python 3.3x above. Now, when I type python in my terminal, I get the python 2.7x interpreter but I want to select python 3.7.2 as interpreter. How can I select the python 3.7.2 interpreter version?

1 Answer 1

2

If both python 2 and python 3 are installed, python runs python 2 by default and python3 runs python 3. If only python 3 is installed, then python runs python 3. python and python3 are just shortcuts to the full path to the binary. Run which python and which python3 to see what they are. Therefore, typing the full path or creating an alias would be one way to select the interpreter that you want.
Another way would be running a specific version of python in a virtual environment. That way you also have complete control over the specific versions of packages that you might use.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.