是因為環境變量設置錯誤
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
更新之前用的是bash終端,mac更新后用的是zsh,
open .zshrc
如果想要正常加載 .bashrc
文件時,就要找到用戶目錄下的 .zshrc
文件加入如下代碼:
if [ -f ~/.bashrc ]; then source ~/.bashrc fi