pyenv is an amazing tool used to manage multiple versions of python in your machine. We have ported it to Windows. We need your thoughts to improve this library and your feedback helps to grow the project.
For existing python users, we support installation via pip.
Contributors and Interested people can join us on @Slack. Your help keeps us motivated!
pyenv for python is a great tool but, like rbenv for ruby developers, it doesn't directly support Windows. After a bit of research and feedback from python developers, I discovered they wanted a similar feature for Windows systems.
This project was forked from rbenv-win and modified for pyenv. It is now fairly mature, thanks to help from many different contributors.
pyenv is a simple python version management tool. It lets you easily switch between multiple versions of Python. It's simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well.
Install pyenv-win in 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"
Reopen PowerShell
Run pyenv --version
to check if the installation was successful.
Run pyenv install -l
to check a list of Python versions supported by pyenv-win
Run pyenv install <version>
to install the supported version
Run pyenv global <version>
to set a Python version as the global version
Check which Python version you are using and its path
> pyenv version
<version> (set by pathto.pyenvpyenv-win.python-version)
Check that Python is working
> python -c "import sys; print(sys.executable)"
pathto.pyenvpyenv-winversions<version>python.exe
commands List all available pyenv commands
local Set or show the local application-specific Python version
latest Print the latest installed or known version with the given prefix
global Set or show the global Python version
shell Set or show the shell-specific Python version
install Install 1 or more versions of Python
uninstall Uninstall 1 or more versions of Python
update Update the cached version DB
rehash Rehash pyenv shims (run this after switching Python versions)
vname Show the current Python version
version Show the current Python version and its origin
version-name Show the current Python version
versions List all Python versions available to pyenv
exec Runs an executable by first preparing PATH so that the selected
Python version's `bin' directory is at the front
which Display the full path to an executable
whence List all Python versions that contain the given executable
Currently we support following ways, choose any of your comfort:
Please see the Installation page for more details.
pyenv --version
pyenv
to view it's usageIf you are getting "command not found" error, check the below note and manually check the settings
For Visual Studio Code or another IDE with a built in terminal, restart it and check again
The environment variables to be set:
C:Users<replace with your actual username>.pyenvpyenv-winbin
C:Users<replace with your actual username>.pyenvpyenv-winshims
Ensure all environment variables are properly set with high priority via the GUI:
This PC
→ Properties
→ Advanced system settings
→ Advanced → System Environment Variables...
→ PATH
NOTE: If you are running Windows 10 1905 or newer, you might need to disable the built-in Python launcher via Start > "Manage App Execution Aliases" and turning off the "App Installer" aliases for Python
pyenv install -l
pyenv install -l | findstr 3.8
pyenv install 3.5.2
pyenv install 2.4.3 3.6.8
pyenv global 3.5.2
pyenv local 3.5.2
.
python
is called from within this folder. This is different than a virtual env, which needs to be explicitly activated.pyenv rehash
to update pyenv with new shims for the python and libraries' executables.
.pyenv
folder.pyenv uninstall 3.5.2
pyenv version
pyenv versions
pyenv update
command for pyenv-win 2.64.x
and 2.32.x
versionseasy_install.pth
file located in site-packages. This should make pip recognise pyenv-win as installed.pip install --upgrade pyenv-win
%USERPROFILE%.pyenvpyenv-win
(which is your installed path) and run git pull
%USERPROFILE%.pyenvpyenv-win
and replace the folders libexec
and bin
with the new ones you just downloaded&"${env:PYENV_HOME}install-pyenv-win.ps1"
To keep in sync with pyenv linux/mac, pyenv-win now installs 64bit versions by default. To support compatibility with older versions of pyenv-win, we maintain a 32bit train (branch) as a separate release.
Both releases can install 64bit and 32bit python versions; the difference is in version names, for example:
> pyenv install -l | findstr 3.8
....
3.8.0-win32
3.8.0
3.8.1rc1-win32
3.8.1rc1
3.8.1-win32
3.8.1
3.8.2-win32
3.8.2
3.9.0-win32
3.9.0
....
> pyenv install -l | findstr 3.8
....
3.8.0
3.8.0-amd64
3.8.1rc1
3.8.1rc1-amd64
3.8.1
3.8.1-amd64
3.8.2
3.8.2-amd64
....
Support for Python versions below 2.4 have been dropped since their installers don't install "cleanly" like versions from 2.4 onward and they're predominantly out of use/support in most environments now.
Please see the FAQ page.
Please see the Changelog page.
testsbat_filestest_install.bat
and testsbat_filestest_uninstall.bat
pyenv-win is licensed under MIT 2019
pyenv-win was developed by Kiran Kumar Kotari and Contributors Thanks for all Contributors and Supports for patience for the latest major release.