通过自制软件安装最新版本的vim时出现PROTOCOL_TLS错误

时间:2017-02-16 20:13:08

标签: python homebrew

我最近通过自制软件(vim)在我的mac上升级了brew install 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错误。

1 个答案:

答案 0 :(得分:0)

我能够通过告诉自制程序使用自定义python版本来解决这个问题。以下是我为使其正常工作所采取的步骤。

brew uninstall vim
brew uninstall python # remove 2.7.13 version
brew switch python 2.7.12
brew install vim --with-custom-python