PROTOCOL_TLS 通过自制软件安装最新版本 vim 时出错
PROTOCOL_TLS error when installing latest version of vim via homebrew
我最近通过自制软件 (brew install vim
) 在我的 mac 上升级了 vim
。这也会更新 Python,但无法更新并因 NameError: name 'PROTOCOL_TLS' is not defined
错误而失败。
这是完整的输出:
$ brew install vim
==> Installing dependencies for vim: python
==> Installing vim dependency: python
==> Downloading https://homebrew.bintray.com/bottles/python-2.7.13.sierra.bottle.tar.gz
Already downloaded: /Users/me/Library/Caches/Homebrew/python-2.7.13.sierra.bottle.tar.gz
==> Pouring python-2.7.13.sierra.bottle.tar.gz
==> Using the sandbox
==> /usr/local/Cellar/python/2.7.13/bin/python -s setup.py --no-user-cfg install --force --verbose --single-version-externally-managed --record=installed.txt --install-scripts=/u
Last 15 lines from /Users/me/Library/Logs/Homebrew/python/post_install.01.python:
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/local/Cellar/python/2.7.13/libexec/setuptools/setuptools/command/install_scripts.py", line 17, in run
import setuptools.command.easy_install as ei
File "/usr/local/Cellar/python/2.7.13/libexec/setuptools/setuptools/command/easy_install.py", line 51, in <module>
from setuptools.package_index import (
File "/usr/local/Cellar/python/2.7.13/libexec/setuptools/setuptools/package_index.py", line 15, in <module>
from urllib2 import splituser
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 94, in <module>
import httplib
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1230, in <module>
import ssl
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 133, in <module>
PROTOCOL_SSLv23 = PROTOCOL_TLS
NameError: name 'PROTOCOL_TLS' is not defined
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall python`
==> Caveats
Pip and setuptools have been installed. To update them
pip install --upgrade pip setuptools
You can install Python packages with
pip install <package>
They will install into the site-package directory
/usr/local/lib/python2.7/site-packages
See: http://docs.brew.sh/Homebrew-and-Python.html
==> Summary
/usr/local/Cellar/python/2.7.13: 3,223 files, 44.3M
==> Installing vim
==> Downloading https://homebrew.bintray.com/bottles/vim-8.0.0329.sierra.bottle.tar.gz
Already downloaded: /Users/me/Library/Caches/Homebrew/vim-8.0.0329.sierra.bottle.tar.gz
==> Pouring vim-8.0.0329.sierra.bottle.tar.gz
/usr/local/Cellar/vim/8.0.0329: 1,713 files, 23.3M
我似乎不知道如何安装它。这也完全使 YouCompleteMe
插件变得乏味。启动时 vim
我看到相同的 PROTOCOL_TLS
错误。
我可以通过告诉自制软件使用自定义 python 版本来解决这个问题。以下是我为使其正常工作所采取的步骤。
brew uninstall vim
brew uninstall python # remove 2.7.13 version
brew switch python 2.7.12
brew install vim --with-custom-python
我最近通过自制软件 (brew install vim
) 在我的 mac 上升级了 vim
。这也会更新 Python,但无法更新并因 NameError: name 'PROTOCOL_TLS' is not defined
错误而失败。
这是完整的输出:
$ brew install vim
==> Installing dependencies for vim: python
==> Installing vim dependency: python
==> Downloading https://homebrew.bintray.com/bottles/python-2.7.13.sierra.bottle.tar.gz
Already downloaded: /Users/me/Library/Caches/Homebrew/python-2.7.13.sierra.bottle.tar.gz
==> Pouring python-2.7.13.sierra.bottle.tar.gz
==> Using the sandbox
==> /usr/local/Cellar/python/2.7.13/bin/python -s setup.py --no-user-cfg install --force --verbose --single-version-externally-managed --record=installed.txt --install-scripts=/u
Last 15 lines from /Users/me/Library/Logs/Homebrew/python/post_install.01.python:
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/local/Cellar/python/2.7.13/libexec/setuptools/setuptools/command/install_scripts.py", line 17, in run
import setuptools.command.easy_install as ei
File "/usr/local/Cellar/python/2.7.13/libexec/setuptools/setuptools/command/easy_install.py", line 51, in <module>
from setuptools.package_index import (
File "/usr/local/Cellar/python/2.7.13/libexec/setuptools/setuptools/package_index.py", line 15, in <module>
from urllib2 import splituser
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 94, in <module>
import httplib
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1230, in <module>
import ssl
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 133, in <module>
PROTOCOL_SSLv23 = PROTOCOL_TLS
NameError: name 'PROTOCOL_TLS' is not defined
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall python`
==> Caveats
Pip and setuptools have been installed. To update them
pip install --upgrade pip setuptools
You can install Python packages with
pip install <package>
They will install into the site-package directory
/usr/local/lib/python2.7/site-packages
See: http://docs.brew.sh/Homebrew-and-Python.html
==> Summary
/usr/local/Cellar/python/2.7.13: 3,223 files, 44.3M
==> Installing vim
==> Downloading https://homebrew.bintray.com/bottles/vim-8.0.0329.sierra.bottle.tar.gz
Already downloaded: /Users/me/Library/Caches/Homebrew/vim-8.0.0329.sierra.bottle.tar.gz
==> Pouring vim-8.0.0329.sierra.bottle.tar.gz
/usr/local/Cellar/vim/8.0.0329: 1,713 files, 23.3M
我似乎不知道如何安装它。这也完全使 YouCompleteMe
插件变得乏味。启动时 vim
我看到相同的 PROTOCOL_TLS
错误。
我可以通过告诉自制软件使用自定义 python 版本来解决这个问题。以下是我为使其正常工作所采取的步骤。
brew uninstall vim
brew uninstall python # remove 2.7.13 version
brew switch python 2.7.12
brew install vim --with-custom-python