10

I installed python3, I can open idle and it says it is running python3.0.1, but when I enter python3 in the terminal (on OSX) I get an error saying 'command not found'. Entering python gets me the 2.x version that came on the computer. Any advice on how I can access python3 from the terminal?

Thanks

3
  • Have you tried calling it from its install location? Commented Oct 9, 2010 at 5:06
  • If it works from the installation directory it's probably a path problem, path as in your environment variables, not sure how to edit them on OSX, if your 2.x version runs fine it's probably pointing to that directory instead of the 3.0.1-directory. Commented Oct 9, 2010 at 5:14
  • @I agree with @dutt. If you were on windows, I could give you detailed instructions, as I've solved this issue a bunch of times. Essentially, the list of paths your system checks lists the python2x directory before the python3 directory. SuperUser may be able to give you better assistance. Commented Oct 9, 2010 at 5:19

1 Answer 1

16

First, don't use Python 3.0.1. It has many problems and was officially retired upon the release of Python 3.1 (currently 3.1.2). You can find the python.org Mac OS X installer for 3.1.2 here. Once it is installed, then you need to ensure that the bin directory from the 3.1.2 framework (/Library/Frameworks/Python.framework/Versions/3.1/bin) is on your shell search path. You can manually modify an appropriate shell startup file, like .bash_profile. Or just double-click the Update Shell Profile.command found in /Applications/Python 3.1. In either case, you will need to open a new terminal window or re-login. Another approach is to install Python 3.1 from MacPorts or another distributor. Also, alpha releases of Python 3.2 are now available from python.org and elsewhere.

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

1 Comment

Glad to hear it. By the way, when you post a question on Stackoverflow, you should either mark an answer as accepted (so that the answerer gets reputation points) or edit your question until you do get a satisfactory answer.

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.