现象:
~ % mkvirtualenv 123-env
zsh: command not found: mkvirtualenv
解决:
1、确认文件which virtualenvwrapper.sh的路径
/Library/Frameworks/Python.framework/Versions/3.9/bin/virtualenvwrapper.sh
2、mkdir ~/pyEnv
3、编辑配置文件:vi ~/.zsrc
export WORKON_HOME=~/pyEnv
VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
source /Library/Frameworks/Python.framework/Versions/3.9/bin/virtualenvwrapper.sh
4、使配置文件生效:
source ~/.zsrc
参考:https://zhuanlan.zhihu.com/p/91371320