我正在尝试从源代码安装ROS。

当我执行安装命令时,出现这样的错误:

Traceback (most recent call last):
  File "/home/zyh/ros_catkin_ws/install_isolated/share/ros/core/rosbuild/bin/download_checkmd5.py", line 126, in <module>
    sys.exit(main())
  File "/home/zyh/ros_catkin_ws/install_isolated/share/ros/core/rosbuild/bin/download_checkmd5.py", line 73, in main
    urllib.urlretrieve('https://github.com/assimp/assimp/archive/v3.1.1.zip', dest)
  File "/usr/lib/python2.7/urllib.py", line 98, in urlretrieve
    return opener.retrieve(url, filename, reporthook, data)
  File "/usr/lib/python2.7/urllib.py", line 245, in retrieve
    fp = self.open(url, data)
  File "/usr/lib/python2.7/urllib.py", line 213, in open
    return getattr(self, name)(url)
  File "/usr/lib/python2.7/urllib.py", line 443, in open_https
    h.endheaders(data)
  File "/usr/lib/python2.7/httplib.py", line 1038, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 882, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 844, in send
    self.connect()
  File "/usr/lib/python2.7/httplib.py", line 1263, in connect
    server_hostname=server_hostname)
  File "/usr/lib/python2.7/ssl.py", line 363, in wrap_socket
    _context=self)
  File "/usr/lib/python2.7/ssl.py", line 611, in __init__
    self.do_handshake()
  File "/usr/lib/python2.7/ssl.py", line 840, in do_handshake
    self._sslobj.do_handshake()
IOError: [Errno socket error] [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:661)
/home/zyh/ros_catkin_ws/install_isolated/share/mk/download_unpack_build.mk:37: recipe for target 'build/assimp-3.1.1/unpacked' failed
make[3]: *** [build/assimp-3.1.1/unpacked] Error 1


我不知道如何解决这个问题。也许是因为我在代理后面工作?如果是这样,如何使urllib.urlretrieve在代理后面工作?

最佳答案

将代理设置添加到您的全局环境,以查看是否可以解决问题。

sudo gedit /etc/environment


然后添加这两行

http_proxy=http://your_proxy.com:443
https_proxy=https://your_proxy.com:443

关于python - python2.7:[SSL:UNKNOWN_PROTOCOL]未知协议(protocol),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/49050788/

10-10 12:45