** 一般要考慮最近是否有別人或者自己修改過環境變量,這種報錯往往是因為環境變量設置錯誤導致的。 **
1. 首先要獲得創建,或者是打開bash_profile的權限,請在命令行中輸入:
export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin
可以實現bash_profile暫時的使用。
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