Python And 'print Ssl.openssl_version' Prints Wrong Version
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.
Post a Comment for "Python And 'print Ssl.openssl_version' Prints Wrong Version"