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

即可。

你可能感兴趣的:(Python)