今天因为要在mac上安装caffe,需要先安装opencv,于是使用命令brew install opencv进行安装。结果出现以下错误:
curl: (7) Failed to connect to gist.github.com port 443: Operation timed out
Error: Failed to download resource "mpfr--patch"
Download failed: https://gist.github.com/anonymous/3a7d24cf2c68f21eb940/raw/471e928fcdbfb5c2fa7428cfb496496e6ee469aa/mpfr-3.1.3.diff
通过其他途径(手动下载该文件放到brew的cache目录下)解决该问题后,在后面的过程中又不断出现类似问题,都是下载https开头的url文件出错。于是google之,在https://github.com/Homebrew/homebrew/issues/43154上找到了解决方案。原来是系统的SSL环境设置有问题,采用其中thomasdziedzic所说的方法设置环境变量即可。具体地,可以在~/.bash_profile末尾添加以下两行:
export SSL_CERT_DIR="/usr/local/etc/openssl/certs"
export SSL_CERT_FILE="/usr/local/etc/openssl/cert.pem"
然后执行source ~/.bash_profile使之生效,再执行brew install opencv就能顺利安装了。
---------------------
作者:strawman_dxj
来源:CSDN
原文:https://blog.csdn.net/strawman_dxj/article/details/50553486
版权声明:本文为博主原创文章,转载请附上博文链接!