命令:
pip3 --default-timeout=100 install kafka-python -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
Looking in indexes: http://pypi.douban.com/simple/
如果直接用pip3 install kafka-python命令,可能会因为网速原因下载失败,报如下错误:
raise ReadTimeoutError(self._pool, None, 'Read timed out.')
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
设置超时等待时间为100,同时更换下载源为douban就好了。
参考:
Python报错pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool解决方法