3

I'm fairly new to Python, but I assume that I need to point something to the new version of python in order to have my system know there is a new version installed. I'm on macOS 10.13.6 and installed the newest python with Homebrew's command brew install python. Any help would be greatly appreciated.

I've tried following this tutorial, but I'm stuck at the portion "ensure PATH....", as it tends to lose me:

# Do I have a Python 3 installed? $ python --version Python 3.6.4 # Success! # If you still see 2.7 ensure in PATH /usr/local/bin/ takes precedence over /usr/bin/ 

1 Answer 1

2

Try python3 --version.

Usually you need to add 3 on the end to anything you do with Python in the terminal.

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

3 Comments

Actually this worked when I tried it, I knew it was installed on my system because I did this and saw "Python 3.7.0", so I guess my question is, is this new version my default version now? I don't know anything about Python, but it seems that if I have to specify python3 to get the newest version, that it isn't going to be used by default.
Again usually if you want to use Python 3 you have to specify with python3. python by itself usually defaults to 2. Neither are your 'default', though, it just depends on which one you use.
Could you expand more on how to "use" Python 3? I'm working on a Python script and need some methods that are only available in Python 3 and they are not working, so I assume my system is still using Python 2. My Shebang is #!/usr/bin/python

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.