2

In short I'm looking to install Python 3 (have a programme that on one of it's recent updates no longer ran with 2.7) I have Homebrew installed (but am not sure how I did it e.g. by Sudo I think?) and am looking to upgrade 2.7 to 3?

For full clarity apparently it's the OpenSSL module which needs upgrading specifically.

What are the ways of doing it?

3
  • 1
    Can you please be more specific on what your actual question is here? How to install python 3 with homebrew, how to fix an OpenSSL issue, how to separate a homebrew installed python from the system version, or something else?
    – nohillside
    Commented Apr 12, 2020 at 11:29
  • Thanks I want to install Python 3 - I gather there are multiple ways of doing it so I was just looking to get my head round all of them and figure out which one I can make work (if that makes sense).
    – user8812
    Commented Apr 12, 2020 at 11:32
  • Let’s move the risks to a second configuration. Enumerating what research and define your risks would help us help you.
    – bmike
    Commented Apr 12, 2020 at 13:55

3 Answers 3

3

As you already seem to have Homebrew installed, a simple

brew install python

should do. It will put python3 into /usr/local/bin so it shouldn't lead to any conflicts with the default installation.

PS: This is just for installing Python 3 though, not sure it solves your OpenSSL error.

4
  • 1
    Thanks. Believe it may be the issue and will report back. I was advised by others that the upgrade to Python 3 should isolate what the problem is "You've got multiple things out of date here, but the crux of your problem is likely python 2.7's OpenSSL module. This has come up in the past. The key part of the error is 'TLSV1_ALERT_PROTOCOL_VERSION'. The easiest test/resolution is to install python 3"
    – user8812
    Commented Apr 12, 2020 at 12:44
  • 1
    @user8812 Hope it works. Otherwise please ask a new question explaining the core issue you are facing (the one which you want to solve with installing python3) and people here can take it from there.
    – nohillside
    Commented Apr 12, 2020 at 12:46
  • Have run into issues with the brew route - turns out my XCode needs updating and I can't support the current build (11.x something) and at the moment am trying to find 9.2 (which hopefully I can - was on 8.x something). Appears not only do I have an old Mac I have several things that need updating.
    – user8812
    Commented Apr 12, 2020 at 15:40
  • Python has been installed as /usr/local/bin/python3 - I take it back it appears to have worked, whether or not it runs without XCode 9+ I don't know. Thanks and I will mark as the answer.
    – user8812
    Commented Apr 12, 2020 at 15:54
2

Just download the MacOS .pkg installer from here:

https://www.python.org/downloads/

Python3 installed this way contains its own version of OpenSSL, instead of the deprecated Apple-bundled libraries that come with python2.7. From the ReadMe:

This variant of Python 3.8 includes its own private copy of OpenSSL 1.1.1. The deprecated Apple-supplied OpenSSL libraries are no longer used.

Then invoke python with python3 command, and use pip3 for installing additional libraries.

0

Another way of installing Python is to use the Anaconda distribution. This will also install many of the modules you may need. Just go to the link and scroll down a page and you can download the Python 3.7 distribution.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .