MAC下产生sudo:command not found

是因为环境变量设置错误

 1.在命令行中输入:

  export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin

 可以实现暂时的使用。

 2.输入cd ~/ #进入当前用户的home目录

 3.创建bash_profile 执行命令:

  touch .bash_profile

 4.打开并编辑bash_profile执行命令:

  open .bash_profile

 5.这样就打开了一个笔记本,会显示已经配置过的path,修改记事本,先全部删除,有用的可以备份,命令行解决后再加

  export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"

  PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}"

  export PATH=$Path:/usr/local/mysql/bin

 6.保存,command + s

 7.在此命令行输入更新命令

  source .bash_profile

 8.然后输入 sudo spctl --master-disable

#转自知乎Bleet

猜你喜欢

转载自www.cnblogs.com/lyj1999/p/10005270.html