Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4582502
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T21:05:02+00:00 2026-05-21T21:05:02+00:00

I have installed Python 3.2 on my Mac. After I run /Applications/Python 3.2/Update Shell

  • 0

I have installed Python 3.2 on my Mac. After I run /Applications/Python 3.2/Update Shell Profile.command, it’s confusing that when I type python -V in Terminal, it says Python 2.6.1 which is not what I expected.

How can I change the default Python version?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T21:05:02+00:00Added an answer on May 21, 2026 at 9:05 pm

    [updated for 2021]

    (Regardless if you are on Mac, Linux, or Windows:)

    If you are confused about how to start the latest version of python, on most platforms it is the case that python3 leaves your python2 installation intact (due to the above compatibility reasons); thus you can start python3 with the python3 command.

    Historically…

    The naming convention is that generally, most scripts will call python2 or python3 explicitly. This happened due to a need for backwards compatibility.

    Even though technically python doesn’t even guarantee backwards compatibility between minor versions, Python3 really breaks backwards compatibility. At the time, programs invoking ‘python‘ were expecting python2 (which was the main version at the time). Extremely old systems may have programs and scripts which expect python=python2, and changing this would break those programs and scripts.

    At the time this answer was written, OP should not have changed this due to maintaining compatibility for old scripts.

    Circa year 2021…

    Nowadays, many years after the python2->python3 transition, most software explicitly refers to python2 or python3 (at least on Linux). For example, they might call #!/usr/bin/env python2 or #!/usr/bin/env python3. This has for example (python-is-python3-package) freed up the python command to be settable to a user default, but it really depends on the operating system.

    The prescription for how distributions should handle the python command was written up in 2011 as PEP 394 — The "python" Command on Unix-Like Systems. It was last updated in June 2019.

    Basically if you are writing a library, you should specify the version of python (2 or 3, or finer-grained under specific circumstances) you can use. Otherwise as an end user, you should feel free to rename this for your own personal use (though your OS or distribution may not make that easy).

    Shell alias:

    You could, however, make a custom alias in your shell. The way you do so depends on the shell, but perhaps you could do alias py=python3, and put it in your shell startup file (.bashrc, .zshrc, etc). This will only work on your local computer (as it should), and is somewhat unnecessary compared to just typing it out (unless you invoke the command constantly).

    Confused users should not try to create aliases or virtual environments or similar that make python execute python3; this is poor form.This is acceptable nowadays, but PEP 394 suggests encouraging users to use a virtualenv instead.

    Different 3.* versions, or 2.* versions:

    In the extremely unlikely case that if someone comes to this question with two python3 versions e.g. 3.1 vs 3.2, and you are confused that you have somehow installed two versions of python, this is possibly because you have done manual and/or manual installations. You can use your OS’s standard package/program install/uninstall/management facilities to help track things down, and perhaps (unless you are doing dev work that surprisingly is impacted by the few backwards-incompatible changes between minor versions) delete the old version (or do make uninstall if you did a manual installation). If you require two versions, then reconfigure your $PATH variable so the ‘default’ version you want is in front; or if you are using most Linux distros, the command you are looking for is sudo update-alternatives. Make sure any programs you run which need access to the older versions may be properly invoked by their calling environment or shell (by setting up the var PATH in that environment).

    A bit about $PATH

    sidenote: To elaborate a bit on PATH: the usual ways that programs are selected is via the PATH (echo $PATH on Linux and Mac) environment variable. You can always run a program with the full path e.g. /usr/bin/ some args, or cd /usr/bin then ./ some args (replace blank with the ‘echo’ program I mentioned above for example), but otherwise typing some args has no meaning without PATH env variable which declares the directories we implicitly may search-then-execute files from (if /usr/bin was not in PATH, then it would say : command not found). The first matching command in the first directory is the one which is executed (the which command on Linux and Mac will tell you which sub-path this is). Usually it is (e.g. on Linux, but similar on Mac) something like /usr/bin/python which is a symlink to other symlinks to the final version somewhere, e.g.:

    % echo $PATH
    /usr/sbin:/usr/local/bin:/usr/sbin:usr/local/bin:/usr/bin:/bin
    
    % which python
    /usr/bin/python
    % which python2
    /usr/bin/python2
    % ls -l /usr/bin/python
    lrwxrwxrwx 1 root root 7 Mar  4  2019 /usr/bin/python -> python2*
    % ls -l /usr/bin/python2  
    lrwxrwxrwx 1 root root 9 Mar  4  2019 /usr/bin/python2 -> python2.7*
    % ls -l /usr/bin/python2.7
    -rwxr-xr-x 1 root root 3689352 Oct 10  2019 /usr/bin/python2.7*
    
    % which python3         
    /usr/bin/python3
    % ls -l /usr/bin/python3
    lrwxrwxrwx 1 root root 9 Mar 26  2019 /usr/bin/python3 -> python3.7*
    % ls -l /usr/bin/python3.7
    -rwxr-xr-x 2 root root 4877888 Apr  2  2019 /usr/bin/python3.7*
    
    % ls -l /usr/bin/python*
    lrwxrwxrwx 1 root root       7 Mar  4  2019 /usr/bin/python -> python2*
    lrwxrwxrwx 1 root root       9 Mar  4  2019 /usr/bin/python2 -> python2.7*
    -rwxr-xr-x 1 root root 3689352 Oct 10  2019 /usr/bin/python2.7*
    lrwxrwxrwx 1 root root       9 Mar 26  2019 /usr/bin/python3 -> python3.7*
    -rwxr-xr-x 2 root root 4877888 Apr  2  2019 /usr/bin/python3.7*
    lrwxrwxrwx 1 root root      33 Apr  2  2019 /usr/bin/python3.7-config -> x86_64-linux-gnu-python3.7-config*
    -rwxr-xr-x 2 root root 4877888 Apr  2  2019 /usr/bin/python3.7m*
    lrwxrwxrwx 1 root root      34 Apr  2  2019 /usr/bin/python3.7m-config -> x86_64-linux-gnu-python3.7m-config*
    lrwxrwxrwx 1 root root      16 Mar 26  2019 /usr/bin/python3-config -> python3.7-config*
    lrwxrwxrwx 1 root root      10 Mar 26  2019 /usr/bin/python3m -> python3.7m*
    lrwxrwxrwx 1 root root      17 Mar 26  2019 /usr/bin/python3m-config -> python3.7m-config*
    

    sidenote2: (In the rarer case a python program invokes a sub-program with the subprocess module, to specify which program to run, one can modify the paths of subprocesses with sys.path from the sys module or the PYTHONPATH environment variable set on the parent, or specifying the full path… but since the path is inherited by child processes this is not remotely likely an issue.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have installed the newest iPython in Mac. However, it uses the Python verion
I am running Mac OS X 10.5.8. I have installed Python 2.6 from the
I have python 2.6.1 installed on Mac OS X. I wanted to play around
Hi there I have downloaded the mac installer here, http://www.python.org/download/releases/3.1.2/ , & installed it.
I am running a windows machine have installed Python 2.5. I also used the
I am using python 2.6 on XP. I have just installed py2exe, and I
I have a Python module installed on my system and I'd like to be
I have an install of python 2.5 that fink placed in /sw/bin/. I use
I have installed CherryPy 3.1.0,. Here is what happens when I try to run
I have just installed PostgreSQL 8.3.4 on Mac OS X 10.5 (using ports), but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.