pyenv for Windows
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!
- Introduction
- pyenv
- pyenv-win commands
- Installation
- Validate installation
- Usage
- How to update pyenv
- Announcements
- FAQ
- Changelog
- How to contribute
- Bug Tracker and Support
- License and Copyright
- Author and Thanks
Introduction
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
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.
Quick start
-
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 \path\to\.pyenv\pyenv-win\.python-version)
-
Check that Python is working
> python -c "import sys; print(sys.executable)" \path\to\.pyenv\pyenv-win\versions\<version>\python.exe
pyenv-win commands
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
Installation
Currently we support following ways, choose any of your comfort:
- PowerShell — easiest way
- Git Commands — default way + adding manual settings
- Pyenv-win zip — manual installation
- Python pip — for existing users
- Chocolatey
- How to use 32-train
- check announcements
Please see the Installation page for more details.
Validate installation
- Reopen the command prompt and run
pyenv --version
- Now type
pyenv
to view it’s usage
If 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
Manually check the settings
The environment variables to be set:
C:\Users\<replace with your actual username>\.pyenv\pyenv-win\bin
C:\Users\<replace with your actual username>\.pyenv\pyenv-win\shims
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
Usage
- To view a list of python versions supported by pyenv windows:
pyenv install -l
- To filter the list:
pyenv install -l | findstr 3.8
- To install a python version:
pyenv install 3.5.2
- Note: An install wizard may pop up for some non-silent installs. You’ll need to click through the wizard during installation. There’s no need to change any options in it. or you can use -q for quiet installation
- You can also install multiple versions in one command too:
pyenv install 2.4.3 3.6.8
- To set a python version as the global version:
pyenv global 3.5.2
- This is the version of python that will be used by default if a local version (see below) isn’t set.
- Note: The version must first be installed.
- To set a python version as the local version:
pyenv local 3.5.2
.- The version given will be used whenever
python
is called from within this folder. This is different than a virtual env, which needs to be explicitly activated. - Note: The version must first be installed.
- The version given will be used whenever
- After (un)installing any libraries using pip or modifying the files in a version’s folder, you must run
pyenv rehash
to update pyenv with new shims for the python and libraries’ executables.- Note: This must be run outside of the
.pyenv
folder.
- Note: This must be run outside of the
- To uninstall a python version:
pyenv uninstall 3.5.2
- To view which python you are using and its path:
pyenv version
- To view all the python versions installed on this system:
pyenv versions
- Update the list of discoverable Python versions using:
pyenv update
command for pyenv-win2.64.x
and2.32.x
versions
How to update pyenv
- If installed via pip
- Add your pyenv-win installation path to
easy_install.pth
file located in site-packages. This should make pip recognise pyenv-win as installed. - Get updates via pip
pip install --upgrade pyenv-win
- Add your pyenv-win installation path to
- If installed via Git
- Go to
%USERPROFILE%\.pyenv\pyenv-win
(which is your installed path) and rungit pull
- Go to
- If installed via zip
- Download the latest zip and extract it
- Go to
%USERPROFILE%\.pyenv\pyenv-win
and replace the folderslibexec
andbin
with the new ones you just downloaded
- If installed via the installer
- Run the following in a Powershell terminal:
&"${env:PYENV_HOME}\install-pyenv-win.ps1"
- Run the following in a Powershell terminal:
Announcements
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:
- 64bit-train (master), i.e. pyenv version 2.64.x
> 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
....
- 32bit-train, i.e. pyenv version 2.32.x
> 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.
FAQ
Please see the FAQ page.
Changelog
Please see the Changelog page.
How to contribute
- Fork the project & clone locally.
- Create an upstream remote and sync your local copy before you branch.
- Branch for each separate piece of work. It’s good practice to write test cases.
- Do the work, write good commit messages, and read the CONTRIBUTING file if there is one.
- Test the changes by running
tests\bat_files\test_install.bat
andtests\bat_files\test_uninstall.bat
- Push to your origin repository.
- Create a new Pull Request in GitHub.
Bug Tracker and Support
- Please report any suggestions, bug reports, or annoyances with pyenv-win through the GitHub bug tracker.
License and Copyright
-
pyenv-win is licensed under MIT 2019
Author and Thanks
pyenv-win was developed by Kiran Kumar Kotari and Contributors
Thanks for all Contributors and Supports for patience for the latest major release.
Последнее обновление: 16.12.2022
На одной рабочей машине одновременно может быть установлено несколько версий Python. Это бывает полезно, когда идет работа с некоторыми внешними библиотеками, которые поддерживают разные версии python, либо в силу каких-то
других причин нам надо использовать несколько разных версий. Например, на момент написания статьи последней и актуальной является версия Python 3.11.
Но, допустим, необходимо также установить версию 3.10, как в этом случае управлять отдельными версиями Python?
Windows
На странице загрузок https://www.python.org/downloads/ мы можем найти ссылку на нужную версию:
И также загрузить ее и установить:
Чтобы при использовании интерпретатора Python не прописывать к нему весь путь, добавим при установке его в переменные среды. Но здесь надо учитывать, что в переменных среды
может содержаться несколько путей к разным интерпретаторам Python:
Та версия Python, которая находится выше, будет версией по умолчанию. С помощью кнопки «Вверх» можно нужную нам версию переместить в начало, сделав версией по умолчанию.
Например, в моем случае это версия 3.11. Соответственно, если я введу в терминале команду
или
то консоль отобразит версию 3.11:
C:\python>python --version Python 3.11.0
Для обращения к версии 3.10 (и всем другим версиям) необходимо использовать указывать номер версии:
C:\python>py -3.10 --version Python 3.10.9
например, выполнение скрипта hello.py
с помощью версии 3.10:
Подобным образом можно вызывать и другие версии Python.
MacOS
На MacOS можно установить разные версии, например, загрузив с официального сайта пакет установщика для определенной версии.
Для обращения к определенной версии Python на MacOS указываем явным образом подверсию в формате python3.[номер_подверсии]
. Например, у меня установлена версия
Python 3.10. Проверим ее версию:
Аналогично обращении к версии python3.9
(при условии если она установлена)
К примеру выполнение скрипта hello.py
с помощью версии python 3.10:
Linux
На Linux также можно установить одновременно несколько версий Python. Например, установка версий 3.10 и 3.11:
sudo apt-get install python3.10 sudo apt-get install python3.11
Одна из версий является версий по умолчанию. И для обращения к ней достаточно прописать python3, например, проверим версию по умолчанию:
Для обращения к другим версиям надо указывать подверсию:
python3.10 --version python3.11 --version
Например, выполнение скрипта hello
с помощью версии Python 3.10:
Но может сложиться ситуация, когда нам надо изменить версию по умолчанию. В этом случае применяется команда update-alternatives для связывания
определенной версии Python с командой python3. Например, мы хотим установить в качестве версии по умолчанию Python 3.11. В этом случае последовательно выполним следующие команды:
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2
Числа справа указывают на приоритет/состояние. Так, для версии 3.11 указан больший приоритет, поэтому при обращении к python3
будет использоваться именно версия 3.11 (в моем случае это Python 3.11.0rc1)
С помощью команды
sudo update-alternatives --config python3
можно изменить версию по умолчанию
Python · October 25, 2024
Python is a versatile programming language that has gained immense popularity due to its simplicity and wide range of applications. However, as new versions are released, developers often find themselves needing to switch between different Python versions for various projects. This tutorial will guide you through the process of switching Python versions on your system, ensuring that you can work seamlessly across different environments.
Understanding Python Versions
Python has multiple versions, with Python 2 and Python 3 being the most notable. Python 2 has reached its end of life, but many legacy systems still rely on it. Python 3, on the other hand, is actively maintained and is the recommended version for new projects. Understanding the differences between these versions is crucial for developers, especially when working on projects that may require specific features or libraries.
Checking Installed Python Versions
Before switching Python versions, it’s essential to check which versions are currently installed on your system. You can do this by running the following commands in your terminal or command prompt:
python --version
python3 --version
These commands will display the installed versions of Python. If you have multiple versions installed, you may see output similar to:
Python 3.8.10
Python 2.7.18
Switching Python Versions on Windows
On Windows, you can switch between Python versions using the following methods:
Using the Python Launcher
The Python Launcher for Windows allows you to specify which version of Python to use when running scripts. You can invoke a specific version by using the command:
py -2 script.py # For Python 2
py -3 script.py # For Python 3
Changing Environment Variables
If you want to change the default Python version, you can modify the system environment variables:
- Right-click on ‘This PC’ or ‘My Computer’ and select ‘Properties.’
- Click on ‘Advanced system settings.’
- In the System Properties window, click on ‘Environment Variables.’
- Under ‘System variables,’ find the ‘Path’ variable and edit it.
- Add the path to the desired Python version at the beginning of the list.
Switching Python Versions on macOS and Linux
On macOS and Linux, switching Python versions can be done using the following methods:
Using the `update-alternatives` Command
For systems that support it, you can use the `update-alternatives` command to manage different versions of Python:
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 2
After setting up alternatives, you can switch versions using:
sudo update-alternatives --config python
Using Virtual Environments
Another effective way to manage Python versions is by using virtual environments. This method allows you to create isolated environments for different projects, each with its own Python version and dependencies. To create a virtual environment, follow these steps:
# Install virtualenv if not already installed
pip install virtualenv
# Create a virtual environment with a specific Python version
virtualenv -p /usr/bin/python3.8 myenv
# Activate the virtual environment
source myenv/bin/activate
Once activated, any Python commands will use the specified version within that environment.
Conclusion
Switching between Python versions is a crucial skill for developers, especially when working on diverse projects. By understanding how to check installed versions and using tools like the Python Launcher, environment variables, and virtual environments, you can easily manage your Python setup. This flexibility allows you to leverage the best features of each version while maintaining compatibility with existing codebases.
For those looking to host their Python applications, consider exploring options for USA VPS Hosting to ensure optimal performance and scalability.
pyenv for Windows
pyenv is a great tool. 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!
- Introduction
- pyenv
- pyenv-win commands
- Installation
- Usage
- How to update pyenv
- Announcements
- FAQ
- How to contribute
- Bug Tracker and Support
- License and Copyright
- Author and Thanks
Introduction
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.
pyenv-win commands
commands List all available pyenv commands local Set or show the local application-specific Python version 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 which Display the full path to an executable whence List all Python versions that contain the given executable
Installation
Currently we support following ways, choose any of your comfort:
- Power Shell — easiest way
- Git Commands — default way + adding manual settings
- Pyenv-win zip — manual installation
- Python pip — for existing users
- Chocolatey
- How to use 32-train
- check announcements
Hurray! When you are done here are steps to Validate
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
Power Shell
The easiest way to install pyenv-win is to run the following installation command in a PowerShell terminal:
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"
If you are getting any UnauthorizedAccess error as below then start Windows PowerShell with the «Run as administrator» option and run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
, now re-run the above installation command.
& : File C:\Users\kirankotari\install-pyenv-win.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170. At line:1 char:173 + ... n.ps1" -OutFile "./install-pyenv-win.ps1"; &"./install-pyenv-win.ps1" + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess
For more information on ‘digitally signed’ or ‘Security warning’ you can refer to following issue #332
Installation is complete!
Git Commands
The default way to install pyenv-win, it needs git commands you need to install git/git-bash for windows
If you are using PowerShell or Git Bash use $HOME
instead of %USERPROFILE%
git clone using command prompt git clone https://github.com/pyenv-win/pyenv-win.git "%USERPROFILE%\.pyenv"
steps to add System Settings
Note: Don’t forget the check above link, it contains final steps to complete.
Installation is complete!
Pyenv-win zip
Manual installation steps for pyenv-win
If you are using PowerShell or Git Bash use $HOME
instead of %USERPROFILE%
-
Download pyenv-win.zip
-
Create a
.pyenv
directory using command promptmkdir %USERPROFILE%/.pyenv
if not exist -
Extract and move files to
%USERPROFILE%\.pyenv\
-
Ensure there is a
bin
folder under%USERPROFILE%\.pyenv\pyenv-win
steps to add System Settings
Note: Don’t forget the check above link, it contains final steps to complete.
Installation is complete!
Python pip
For existing python users
If you are using PowerShell or Git Bash use $HOME
instead of %USERPROFILE%
installation command via command prompt
pip install pyenv-win --target %USERPROFILE%\\.pyenv
if you having an error on above command use the folllowing to resolve it. ref. link #303
pip install pyenv-win --target %USERPROFILE%\\.pyenv --no-user --upgrade
steps to add System Settings
Note: Don’t forget the check above link, it contains final steps to complete.
Installation is complete!
Chocolatey
This needs choco commands to install, installation link
Chocolatey command choco install pyenv-win
Chocolatey page: pyenv-win
Installation is complete!
Validate Installation
Add System Settings
It’s a easy way to use PowerShell here
- Adding PYENV, PYENV_HOME and PYENV_ROOT to your Environment Variables
[System.Environment]::SetEnvironmentVariable('PYENV',$env:USERPROFILE + "\.pyenv\pyenv-win\","User") [System.Environment]::SetEnvironmentVariable('PYENV_ROOT',$env:USERPROFILE + "\.pyenv\pyenv-win\","User") [System.Environment]::SetEnvironmentVariable('PYENV_HOME',$env:USERPROFILE + "\.pyenv\pyenv-win\","User")
- Now adding the following paths to your USER PATH variable in order to access the pyenv command
[System.Environment]::SetEnvironmentVariable('path', $env:USERPROFILE + "\.pyenv\pyenv-win\bin;" + $env:USERPROFILE + "\.pyenv\pyenv-win\shims;" + [System.Environment]::GetEnvironmentVariable('path', "User"),"User")
Installation is done. Hurray!
How to use 32-train
Using Git
- For 32-train prerequisite is installing pyenv-win using Git
- Go to .pyenv dir command
cd %USERPROFILE%\.pyenv
- run
git checkout -b 32bit-train origin/32bit-train
- run
pyenv --version
and you should see 2.32.x
Using pip
-
run
pip install pyenv-win==2.32.x --target %USERPROFILE%\.pyenv
-
steps to add System Settings
Using Zip
-
Download pyenv-win.zip
-
Follow step 2 from Pyenv-win zip
-
steps to add System Settings
Validate
- Reopen the command prompt and run
pyenv --version
- Now type
pyenv
to view it’s usage
If 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
Manually check the settings
Ensure all environment variables are properly set via the GUI:
This PC
→ Properties
→ Advanced system settings
→ Advanced → 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
Usage
- To view a list of python versions supported by pyenv windows:
pyenv install -l
- To filter the list:
pyenv install -l | findstr 3.8
- To install a python version:
pyenv install 3.5.2
- Note: An install wizard may pop up for some non-silent installs. You’ll need to click through the wizard during installation. There’s no need to change any options in it. or you can use -q for quiet installation
- You can also install multiple versions in one command too:
pyenv install 2.4.3 3.6.8
- To set a python version as the global version:
pyenv global 3.5.2
- This is the version of python that will be used by default if a local version (see below) isn’t set.
- Note: The version must first be installed.
- To set a python version as the local version:
pyenv local 3.5.2
.- The version given will be used whenever
python
is called from within this folder. This is different than a virtual env, which needs to be explicitly activated. - Note: The version must first be installed.
- The version given will be used whenever
- After (un)installing any libraries using pip or modifying the files in a version’s folder, you must run
pyenv rehash
to update pyenv with new shims for the python and libraries’ executables.- Note: This must be run outside of the
.pyenv
folder.
- Note: This must be run outside of the
- To uninstall a python version:
pyenv uninstall 3.5.2
- To view which python you are using and its path:
pyenv version
- To view all the python versions installed on this system:
pyenv versions
- Update the list of discoverable Python versions using:
pyenv update
command for pyenv-win2.64.x
and2.32.x
versions
How to update pyenv
- If installed via pip
- Add your pyenv-win installation path to
easy_install.pth
file located in site-packages. This should make pip recognise pyenv-win as installed. - Get updates via pip
pip install --upgrade pyenv-win
- Add your pyenv-win installation path to
- If installed via Git
- Go to
%USERPROFILE%\.pyenv\pyenv-win
(which is your installed path) and rungit pull
- Go to
- If installed via zip
- Download the latest zip and extract it
- Go to
%USERPROFILE%\.pyenv\pyenv-win
and replace the folderslibexec
andbin
with the new ones you just downloaded
- If installed via the installer
- Run the following in a Powershell terminal:
&"${env:PYENV_HOME}\install-pyenv-win.ps1"
- Run the following in a Powershell terminal:
Announcements
==================
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:
- 64bit-train (master), i.e. pyenv version 2.64.x
> 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
....
- 32bit-train, i.e. pyenv version 2.32.x
>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.
==================
FAQ
-
Question: Does pyenv for windows support python2?
- Answer: Yes, We support python2 from version 2.4+ until python.org officially removes it.
- Versions below 2.4 use outdated Wise installers and have issues installing multiple patch versions, unlike Windows MSI and the new Python3 installers that support «extraction» installations.
-
Question: Does pyenv for windows support python3?
- Answer: Yes, we support python3 from version 3.0. We support it from 3.0 until python.org officially removes it.
-
Question: I am getting the issue
batch file cannot be found.
while installing python, what should I do?- Answer: You can ignore it. It’s just calling
pyenv rehash
command before creating the bat file on some devices.
- Answer: You can ignore it. It’s just calling
-
Question: System is stuck while uninstalling a python version
- Answer: Navigate to the location where you installed pyenv, open its ‘versions’ folder (usually
%USERPROFILE%\.pyenv\pyenv-win\versions
), and delete the folder of the version you want removed.
- Answer: Navigate to the location where you installed pyenv, open its ‘versions’ folder (usually
-
Question: I installed pyenv-win using pip. How can I uninstall it?
- Answer: Follow the pip instructions in How to update pyenv and then run
pip uninstall pyenv-win
- Answer: Follow the pip instructions in How to update pyenv and then run
-
Question: pyenv-win is not recognised, but I have set the ENV PATH?
- Answer: According to Windows, when adding a path under the User variable you need to logout and login again, in order to reflect any change. For the System variable it’s not required.
Change Log
New in 3.1.1
- Fix #413: bug: pyenv install failing because the system cannot find the file specified ‘dark.exe’
- Adding: python 3.8, 3.9 and 3.10 in classifiers
New in 3.1
- Fix #142: Prefer the local installer over the web based installer
- Fix #401, #396, #383 and #360: Added the same level of support for local based installer as we have for web based installers in #410
- Note: It is best to uninstall affected versions (3.9.11 and above) via Windows’
Add or remove Programs
systems settings page before running thepyenv uninstall
command for those versions.
- Note: It is best to uninstall affected versions (3.9.11 and above) via Windows’
New in 3.0
- Fix #311: Support many global and shell versions.
- Fix #318:
pyenv global
andpyenv local
no longer affect PYENV_VERSION, which onlypyenv shell
should affect. - The test suite emulates a 32 bit architecture environment.
- The test suite now also runs tests using
powershell
andpwsh
in addition tocmd
. pyenv shell
now works likepyenv global
andpyenv local
in that, on 32-bit platforms, it adds-win32
to every supplied version if not explicitly added.
New in 2.64.11
- Fix #287: Prevent infinite recursion by removing the shims directory from the path.
- Fix #259: Correctly handle spaces in
pyenv
path. - Fix #305: Fix
exec
preferring the last version listed in.python-version
instead of the first.- Note:
pyenv rehash
must be called after upgrading. Expect the following error message if you don’t:'Scripts' is not recognized as an internal or external command, operable program or batch file.
- Note:
New in 2.64.10
- Check
PATH
inpyenv version
to report other Python versions.
New in 2.64.9
- Feature #210: Support extended installer options
- Fix #269: Migration from travis-ci to GitHub Actions
- Fix
exec
shims forbat
files. - Fix #193: PowerShell support for
pyenv shell
New in 2.64.8
- Fix #198: PEP 514 support (64 bits only, excluding pypy).
New in 2.64.7.4
- Fix #256: Fix
pyenv --version
for username with space.
New in 2.64.7.3
- Fix #254: Fix exec with many local versions.
New in 2.64.7.2
- Fix #250: PATH is not impacted after a
pyenv exec
.
New in 2.64.7.1
- Fix #246:
pyenv which
andpyenv whence
show help if no argument specified. - Fix exec problems after merge of #140.
- Fix #247: no more incorrect file name in bash script if username contains a space.
- Fix #243: hot fix for
pyenv exec
.
New in 2.64.6.1
- Use GitHub Actions to publish to PyPi.
New in 2.64.5
- Fix #239: Improve
rehash
error when no version installed. - Add pypy support.
- Fix #140: Get rid of temp
exec.bat
to support multiple exec in parallel.
New in 2.64.4
- More python versions supported.
- Fix #217: Add missing call to
exec.bat
. - Enhancement #225: Add tox support.
- Fix #204: Support many local versions.
- Enhancement #220: Rehash all installed versions with more shims.
- Enhancement #221: Add
pyenv global --unset
.
New in 2.64.3
- Version naming conventions have now changed from using 64-bit suffixes when specifying a version to (un)install. Now all you need to use is the version number to install your platform’s specific bit version.
- *WARNING*: This change is backwards incompatible with v1.2.5 or less; if upgrading from that version, install 32bit-train which is backward compatible, or uninstall all versions of python prior to upgrading pyenv.
- Ex.
pyenv install 2.7.17
will install as 64-bit on x64 and 32-bit on x86. (64-bit can still use2.7.17-win32
to install the 32-bit version) pyenv global/local/shell
also now recognize your platform and select the appropriate bit version. (64-bit users will need to specify[version]-win32
to use the 32-bit versions now)
- Added support for true unobtrusive, local installs.
- *WARNING*: This change is backwards incompatible with v1.2.5 or less; if upgrading from that version, install 32bit-train which is backward compatible, or uninstall all versions of python prior to upgrading pyenv.
- No install/uninstall records are written to the registry or Start Menu anymore (no «Programs and Features» records).
- When installing a patch version of python (ex. 3.6.1) installing another patch version (ex. 3.6.2) won’t reuse the same folder and overwrite the previously installed minor version. They’re now kept separate.
- Uninstalls are now a simple folder deletion. (Can be done manually by the user safely now or
pyenv uninstall
)
- Added support for (un)installing multiple versions of python in a single command or all DB versions via the
-a/--all
switch.- When using
--all
on x64 computers you can use--32only
or--64only
to install only 32-bit or only 64-bit version s of python. (Does nothing on 32-bit computers, and better filters may be in the works later on)
- When using
pyenv global/rehash
is called automatically after (un)installing a new Python version. (last version specified, if installing multiple)- Pyenv now uses a cached DB of versions scraped straight from the Python mirror site and can be updated manually by a user using
pyenv update
. Users no longer have to wait for pyenv’s source repo to be updated to use a new version of Python when it releases, and can also use the new alpha/beta python releases. pyenv install
now has a-c/--clear
to empty cached installers in the%PYENV%\install_cache
folder.pyenv rehash
now acknowledges %PATHEXT% (plus PY and PYW) when creating shims instead of just for exe, bat, cmd and py files so more executables are available from\Scripts
and libraries installed using pip.- Shims created using
pyenv rehash
no longer callpyenv exec
, but instead call python directly to prevent issues with other programs executing the shims. - Shims now use cp1250 as the default code page since Python2 will never actually support cp65001. cp1250 has better support for upper ANSI characters (ex. «Pokémon»), but still isn’t full UTF-8 compatible.
- Note: 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.
How to contribute
- Fork the project & clone locally.
- Create an upstream remote and sync your local copy before you branch.
- Branch for each separate piece of work. It’s good practice to write test cases.
- Do the work, write good commit messages, and read the CONTRIBUTING file if there is one.
- Test the changes by running
tests\bat_files\test_install.bat
andtests\bat_files\test_uninstall.bat
- Push to your origin repository.
- Create a new Pull Request in GitHub.
Bug Tracker and Support
- Please report any suggestions, bug reports, or annoyances with pyenv-win through the GitHub bug tracker.
License and Copyright
-
pyenv-win is licensed under MIT 2019
Author and Thanks
pyenv-win was developed by Kiran Kumar Kotari and Contributors
Thanks for all Contributors and Supports for patience for the latest major release.