一、下载 pyenv
pyenv-win
使用 powershell 下载
Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/pyenv-win/pyenv-win/master/pyenv-win/install-pyenv-win.ps1" -OutFile "./install-pyenv-win.ps1"; &"./install-pyenv-win.ps1"
二、可能会遇到的问题
解决方法:设置powershell执行策略
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
执行结果图
三、pyenv 相关指令
commands List all available pyenv commandslocal Set or show the local application-specific Python versionlatest Print the latest installed or known version with the given prefixglobal Set or show the global Python versionshell Set or show the shell-specific Python versioninstall Install 1 or more versions of Pythonuninstall Uninstall 1 or more versions of Pythonupdate Update the cached version DBrehash Rehash pyenv shims (run this after switching Python versions)vname Show the current Python versionversion Show the current Python version and its originversion-name Show the current Python versionversions List all Python versions available to pyenvexec Runs an executable by first preparing PATH so that the selected Python version's `bin' directory is at the frontwhich Display the full path to an executablewhence List all Python versions that contain the given executable
四、查看是否安装成功 (需要重新打开 powershell)
pyenv --version