Python Forum
Updating Python on Mac OS X (version 10.12.6)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Updating Python on Mac OS X (version 10.12.6)
#1
I went to Python's main website and I downloaded the correct Python 3.7.0 files for my system, and I just set up and updated pip, and imported certifi, but when I checked what version of Python my system was running, it said Python 2.7. How do I get my system to actually use the new version of Python?

Thanks!
Reply
#2
Default meaning of Python on the command-line may not be clear. Python is usually an alias for python2.7 (but it can sometimes be an alias for older versions like python2.6 or python2.5). To find out exactly which version of Python you're using, you can use the --version flag.

$ python --version

Python 3 is usually available under the name of python3.

$ python3 --version

To use version 3.7:

$ python3.7

Your system, i.e. macOS will not use 3.7, furthermore (Documentation >>> Python Setup and Usage >>> Using Python on Macintosh):

Quote:The Apple-provided build of Python is installed in /System/Library/Frameworks/Python.framework and /usr/bin/python, respectively. You should never modify or delete these, as they are Apple-controlled and are used by Apple- or third-party software. Remember that if you choose to install a newer Python version from python.org, you will have two different but functional Python installations on your computer, so it will be important that your paths and usages are consistent with what you want to do.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply
#3
Doing it Right Mac

Alternative pyenv(Simple Python Version Management) also work on Mac.
Example how it look on Linux:
# Update pyenv
mint@mint ~ $ pyenv update
 
# Look at what's available
mint@mint ~ $ pyenv install --list
Available versions:
....
3.6.6
  3.6.6rc1
  3.7.0
  3.7-dev
  3.8-dev
....
 
# Update needed
sudo apt-get update
sudo apt-get install libffi-dev
 
# install
mint@mint ~ $ pyenv install 3.7.0
Installing Python-3.7.0...
Installed Python-3.7.0 to /home/mint/.pyenv/versions/3.7.0
 
# Set python and pip to point to 3.7
mint@mint ~ $ pyenv global 3.7.0
mint@mint ~ $ python -V
Python 3.7.0
mint@mint ~ $ pip -V
pip 10.0.1 from /home/mint/.pyenv/versions/3.7.0/lib/python3.7/site-packages/pip (python 3.7)
mint@mint ~ $ 
# Finish
So now do python and pip always point to what you set global in this case 3.7.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Updating to Python 3.10 on Windows rafaeldominiquini 4 14,526 Oct-12-2021, 01:59 AM
Last Post: Underscore
  Query on choosing Python 3.8.6 version sureshnagarajan 0 1,811 Feb-16-2021, 05:30 AM
Last Post: sureshnagarajan
  Which Python Version? muzikman 15 5,221 Jan-19-2021, 02:16 PM
Last Post: muzikman
  Python/winrt support for python 3.8 version pbvinoth 2 3,715 Jul-08-2020, 02:03 PM
Last Post: snippsat
  Issue with 2 version of python (2.6.6 and 2.7) with pip himupant94 2 3,242 Apr-24-2020, 03:23 AM
Last Post: himupant94
  Default python version on Windows (3.6.x vs 3.6.y) gramakri 1 2,467 May-04-2019, 10:36 PM
Last Post: snippsat
  Old Python-version used by IDLE GeNoS 7 4,250 Apr-13-2019, 08:04 PM
Last Post: Gribouillis
  Trouble installing a old version of python - 3.4.1 alex8obrien 2 2,799 Apr-09-2019, 06:28 AM
Last Post: alex8obrien
  a special version of the python command Skaperen 6 4,163 Apr-06-2019, 02:25 PM
Last Post: Gribouillis
  Distributing custom version of Python touc82 1 2,100 Mar-23-2019, 03:23 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020