curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection reset by peer解决

如果你要在homebrew安装指定python版本,比如3.7.x回退3.6的时候,一般使用

brew install --ignore-dependencies https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb

但是你可能会遇到如下错误:

curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection reset by peer

解决办法:https改为http即可

brew install --ignore-dependencies http://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb

当然你也可以在展开的curl命令添加proxy(如果你有一个socks5代理为127.0.0.1:1080
比如错误信息:

curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection reset by peer
Error: Failure while executing; `/usr/bin/curl -q --globoff --show-error --user-agent Homebrew/2.2.9\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 10.15.3\)\ curl/7.64.1 --fail --progress-bar --location --remote-time --continue-at 0 --output /Users/simonliu/Library/Caches/Homebrew/Formula/python.rb https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb` exited with 7. Here's the output:
##O#- #
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection reset by peer

在brew命令前添加

ALL_PROXY=socks5://127.0.0.1:1080

即可。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值