我在使用 .zprofile 时遇到了错误。每次打开 macOS 终端时都会看到这个错误。
终端
/Users/leo/.zprofile:6: no such file or directory: /opt/homebrew/bin/brew
/Users/leo/.zprofile:7: no such file or directory: /opt/homebrew/bin/brew
.zprofile 内部显示:
# Setting PATH for Python 3.11
# The original version is saved in .zprofile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.11/bin:${PATH}"
export PATH
eval "$(/opt/homebrew/bin/brew shellenv)"
eval "$(/opt/homebrew/bin/brew shellenv)"
我找到了类似的问题,他们建议编辑 .zprofile,但我不明白具体是什么。也许还有其他解决方案可以避免在终端中显示此错误,或者我需要删除/编辑什么?