尝试安装Certbot后出现Homebrew / Python错误

时间:2019-05-25 21:26:54

标签: python homebrew certbot

我试图在我的macOS计算机(10.14.4)上安装Certbot来生成证书,但是像往常一样,一些Homebrew错误正在困扰您。

运行brew updatebrew install certbot之后,我尝试了基于sudo certbot certonly -a manual -d example.com --email your@email.com的命令,但得到了sudo: certbot: command not found。我也尝试过brew upgrade

brew doctor显示:

Warning: The following directories do not exist:
/usr/local/sbin

You should create these directories and change their ownership to your account.
  sudo mkdir -p /usr/local/sbin
  sudo chown -R $(whoami) /usr/local/sbin

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  python@2
  python

brew link python返回Linking /usr/local/Cellar/python/3.7.3... Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks

由于某种原因,看来我现在已经安装了2个版本的Python,并且在我知道需要之前,我不希望运行Homebrew建议的任何命令。 python --version返回Python 2.7.10

我应该卸载我的Python之一吗?其中一个是系统版本还是在其他地方进行了第三次安装?我应该符号链接哪一个,如何使certbot命令起作用?预先感谢

1 个答案:

答案 0 :(得分:1)

sudo mkdir /usr/local/Frameworks
sudo chmod 1777 

然后

brew link python3

这将在Mac上安装python3 我不会卸载python 2.7,因为仍然有很多脚本依赖于python 2.7!