一、官方网址
linux:https://github.com/pyenv/pyenv
windows:https://github.com/pyenv-win/pyenv-win#installation
二、这边使用git安装
git clone https://github.com/pyenv-win/pyenv-win.git "$HOME/.pyenv"
三、安装后
powershell中执行
[System.Environment]::SetEnvironmentVariable('PYENV',$env:USERPROFILE + "\.pyenv\pyenv-win\","User")
[System.Environment]::SetEnvironmentVariable('PYENV_HOME',$env:USERPROFILE + "\.pyenv\pyenv-win\","User")
如果powershell阻止,请用管理员打开powershell
执行下面代码,选择全是
set-executionpolicy remotesigned
四、再次执行
[System.Environment]::SetEnvironmentVariable('path', $env:USERPROFILE + "\.pyenv\pyenv-win\bin;" + $env:USERPROFILE + "\.pyenv\pyenv-win\shims;" + [System.Environment]::GetEnvironmentVariable('path', "User"),"User")

本文详细指导如何在Windows环境下通过Git克隆并安装Pyenv,包括设置环境变量和验证安装。适合快速上手Python环境管理器。
最低0.47元/天 解锁文章
1109

被折叠的 条评论
为什么被折叠?



