Skip to content Skip to sidebar Skip to footer

Python And 'print Ssl.openssl_version' Prints Wrong Version

I was working with Steffen Ullrich on a previous issue, and now it is morphing into a new issue. So taking his advice (thank you Steffen), I am posting a separate question: $ pyth

Solution 1:

You also need to install Python that is linked to that Homebrew OpenSSL library, try with:

brew install python --with-brewed-openssl

Beware, tho, that it will not replace your 'native' Python, you'll have to relink it. By default, it will be installed in /usr/local/Cellar/python/<version>, whereas the version may change with time. If you want you can relink the python binary as:

sudo mv /usr/bin/python /usr/bin/python.old 2>/dev/null
sudo ln -s -f /usr/local/Cellar/python/<version>/bin/python /usr/bin/python

But I'd suggest you to create a local link so you can use both python versions:

sudo mv /usr/local/bin/python /usr/local/bin/python.old 2>/dev/null
sudo ln -s -f /usr/local/Cellar/python/<version>/bin/python /usr/local/bin/python

(of course, replacing the <version> with whichever version of Python Homebrew installed at the time of trying the above)

And then when you need this 'upgraded' Python just launch your scripts with /usr/local/bin/python script.py or use /usr/local/bin/python as their shebang.

Solution 2:

Incase anyone else has the same issues, I wanted to provide the link to the original (1st half of the issue) so that others may get a full picture.

macOS Sierra/Python2.7.13 URLError: <urlopen error EOF occurred in violation of protocol (_ssl.c:661)>

Post a Comment for "Python And 'print Ssl.openssl_version' Prints Wrong Version"