ValueError: check_hostname requires server_hostname问题的解决

在vps上执行“pip install cymysql”安装cymysql的时候,出现如下错误:

    File "/usr/local/lib/python2.7/site-packages/pip-6.0.8-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py", line 254, in ssl_wrap_socket
      return context.wrap_socket(sock)
    File "/usr/local/lib/python2.7/ssl.py", line 350, in wrap_socket
      _context=self)
    File "/usr/local/lib/python2.7/ssl.py", line 537, in __init__
      raise ValueError("check_hostname requires server_hostname")
  ValueError: check_hostname requires server_hostname

解决办法:

pip --trusted-host pypi.python.org install cymysql

 

pip使用说明里有这么一段:

 --trusted-host <hostname>   Mark this host as trusted, even though it does
                              not have valid or any HTTPS.

 

此条目发表在IT分类目录,贴了, , , 标签。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。

*