将 python 版本从 3.11 降级到 3.10.11 (mac)

在使用nvm 安装node js v14时候报错

Node.js configure: Found Python 3.11.2
please use Python 3.10  or Python 2.7

1 安装 pyenv

brew install pyenv

2 ~/.zpprofile 添加环境变量

export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

3 安装指定版本python

pyenv install 3.10.11

4 然后将环境设置为PYENV_VERSION您要使用的 python 版本

pyenv global 3.10.11
pyenv shell 3.10.11

5 在安装 nvm install v14

Now using node v14.21.3 (npm v6.14.18)

猜你喜欢

转载自blog.csdn.net/sinat_29843547/article/details/130528245