Time To Upgrade Your Python

When I used pip to install pylint in a virtual environment today, I found that the TLS version was too low.

(py3env) ☁  py3env  pip install pylint 
Collecting pylint
  Could not fetch URL https://pypi.python.org/simple/pylint/: 
There was a problem confirming the ssl certificate: 
[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:720) - skipping
  Could not find a version that satisfies the requirement pylint (from versions: )
No matching distribution found for pylint

Then remembered there was an article last year saying that python.org and pypi will stop supporting TLS 1.0 and 1.1 and found this article again

http://pyfound.blogspot.in/2017/01/time-to-upgrade-your-python-tls-v12.html 

clearly stated in the article

Mac users should pay special attention. So far, the system Python shipped with MacOS does not yet support TLSv1.2 in any MacOS version; beginning next June these system Pythons will no longer be able to "pip install" packages.

Mac users should take special note that the system Python that ships with MacOS so far does not support TLSv1.2 in any MacOS version. So it's time to upgrade the version of python3, and you can experience the asynchronous parser and generator of python 3.6.

Record the process of upgrading to os X to upgrade to python3.6.

1. It is necessary to switch the source of Homebrew first, the mirror source of University of Science and Technology of China

替换brew.git:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

2. Update python3, the direct installation will automatically update.

brew install python3

There is a problem during the update process:

Error: The `brew link` step did not complete successfully

Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks

When you encounter this permission problem, execute the following,

sudo mkdir -p /usr/local/Frameworks

sudo chown -R $(whoami) /usr/local/* 

then executing

brew link python3

You may encounter this problem after:

Linking /usr/local/Cellar/python3/3.6.4_1... 

Error: Could not symlink bin/idle3

Target /usr/local/bin/idle3

already exists. You may want to remove it:

  rm '/usr/local/bin/idle3'

To force the link and overwrite all conflicting files:

  brew link --overwrite python3

To list all files that would be deleted:

  brew link --overwrite --dry-run python3

Just a reminder to delete the ones that should be deleted. 

rm /usr/local/bin/idle3
rm /usr/local/bin/pydoc3

在执行
brew link --overwrite python3

This installs successfully.

 

Reference link:

Brew source update: https://www.zhihu.com/question/31360766

Announcement on the end of support for low version TLS:  http://pyfound.blogspot.in/2017/01/time-to-upgrade-your-python-tls-v12.html

brew install python3 issue:  https://github.com/Homebrew/homebrew-core/issues/20985

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324413626&siteId=291194637
Recommended