Package: pyenv-win
pyenv for Windowspyenvis 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 supportinstallation via pip.Contributors and Interested people can join us on @Slack. Your help keeps us motivated!Introductionpyenvpyenv-win commandsInstallationUsageHow to update pyenvAnnouncementsFAQHow to contributeBug Tracker and SupportLicense and CopyrightAuthor and ThanksIntroductionpyenvfor python is a great tool but, likerbenvfor 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 fromrbenv-winand modified forpyenv. It is now fairly mature, thanks to help from many different contributors.pyenvpyenvis 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 commandscommands     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 executableInstallationCurrently we support following ways, choose any of your comfort:Power Shell- easiest wayGit Commands- default way + adding manual settingsPyenv-win zip- manual installationPython pip- for existing usersChocolateyHow to use 32-traincheck announcementsHurray! When you are done here are steps toValidateNOTE: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 PythonPower ShellThe 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 anyUnauthorizedAccesserror as below then start Windows PowerShell with the "Run as administrator" option and runSet-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine, now re-run the above installation command.&:FileC:\Users\kirankotari\install-pyenv-win.ps1cannotbeloadedbecauserunningscriptsisdisabledonthissystem.Formoreinformation,seeabout_Execution_Policiesathttps:/go.microsoft.com/fwlink/?LinkID=135170.Atline:1char:173+...n.ps1" -OutFile "./install-pyenv-win.ps1"; &"./install-pyenv-win.ps1"+ ~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo          : SecurityError: (:) [], PSSecurityException+ FullyQualifiedErrorId : UnauthorizedAccessFor more information on 'digitally signed' or 'Security warning' you can refer to following issue#332Installation is complete!Git CommandsThe default way to install pyenv-win, it needs git commands you need to install git/git-bash for windowsIf you are using PowerShell or Git Bash use$HOMEinstead of%USERPROFILE%git clone using command promptgit clone https://github.com/pyenv-win/pyenv-win.git "%USERPROFILE%\.pyenv"steps toadd System SettingsNote:Don't forget the check above link, it contains final steps to complete.Installation is complete!Pyenv-win zipManual installation steps for pyenv-winIf you are using PowerShell or Git Bash use$HOMEinstead of%USERPROFILE%Downloadpyenv-win.zipCreate a.pyenvdirectory using command promptmkdir %USERPROFILE%/.pyenvif not existExtract and move files to%USERPROFILE%\.pyenv\Ensure there is abinfolder under%USERPROFILE%\.pyenv\pyenv-winsteps toadd System SettingsNote:Don't forget the check above link, it contains final steps to complete.Installation is complete!Python pipFor existing python usersIf you are using PowerShell or Git Bash use$HOMEinstead of%USERPROFILE%installation command via command promptpip install pyenv-win --target %USERPROFILE%\\.pyenvif you having an error on above command use the folllowing to resolve it. ref. link#303pip install pyenv-win --target %USERPROFILE%\\.pyenv --no-user --upgradesteps toadd System SettingsNote:Don't forget the check above link, it contains final steps to complete.Installation is complete!ChocolateyThis needs choco commands to install,installation linkChocolatey commandchoco install pyenv-winChocolatey page:pyenv-winInstallation is complete!Validate InstallationAdd System SettingsIt's a easy way to use PowerShell hereAdding 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-trainUsing GitFor 32-train prerequisite isinstalling pyenv-win using GitGo to .pyenv dir commandcd %USERPROFILE%\.pyenvrungit checkout -b 32bit-train origin/32bit-trainrunpyenv --versionand you should see2.32.xUsing piprunpip install pyenv-win==2.32.x --target %USERPROFILE%\.pyenvsteps toadd System SettingsUsing ZipDownloadpyenv-win.zipFollow step 2 fromPyenv-win zipsteps toadd System SettingsValidateReopen the command prompt and runpyenv --versionNow typepyenvto view it's usageIf you are getting "command not found" error, check the below note andmanually check the settingsFor Visual Studio Code or another IDE with a built in terminal, restart it and check againManually check the settingsEnsure all environment variables are properly set via the GUI:This PC 
   → Properties
      → Advanced system settings 
         → Advanced → Environment Variables... 
            → PATHNOTE: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 PythonUsageTo view a list of python versions supported by pyenv windows:pyenv install -lTo filter the list:pyenv install -l | findstr 3.8To install a python version:pyenv install 3.5.2Note: 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 installationYou can also install multiple versions in one command too:pyenv install 2.4.3 3.6.8To set a python version as the global version:pyenv global 3.5.2This 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 wheneverpythonis 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.After (un)installing any libraries using pip or modifying the files in a version's folder, you must runpyenv rehashto update pyenv with new shims for the python and libraries' executables.Note: This must be run outside of the.pyenvfolder.To uninstall a python version:pyenv uninstall 3.5.2To view which python you are using and its path:pyenv versionTo view all the python versions installed on this system:pyenv versionsUpdate the list of discoverable Python versions using:pyenv updatecommand for pyenv-win2.64.xand2.32.xversionsHow to update pyenvIf installed via pipAdd your pyenv-win installation path toeasy_install.pthfile located in site-packages. This should make pip recognise pyenv-win as installed.Get updates via pippip install --upgrade pyenv-winIf installed via GitGo to%USERPROFILE%\.pyenv\pyenv-win(which is your installed path) and rungit pullIf installed via zipDownload the latest zip and extract itGo to%USERPROFILE%\.pyenv\pyenv-winand replace the folderslibexecandbinwith the new ones you just downloadedIf installed via the installerRun the following in a Powershell terminal:&"${env:PYENV_HOME}\install-pyenv-win.ps1"Announcements==================To keep in sync withpyenvlinux/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 version2.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 version2.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.==================FAQQuestion: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 issuebatch file cannot be found.while installing python, what should I do?Answer:You can ignore it. It's just callingpyenv rehashcommand before creating the bat file on some devices.Question:System is stuck while uninstalling a python versionAnswer: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.Question:I installed pyenv-win using pip. How can I uninstall it?Answer:Follow the pip instructions inHow to update pyenvand then runpip uninstall pyenv-winQuestion: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 LogNew in 3.1.1Fix#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 classifiersNew in 3.1Fix#142: Prefer the local installer over the web based installerFix#401,#396,#383and#360: Added the same level of support for local based installer as we have for web based installers in#410Note:It is best to uninstall affected versions (3.9.11 and above) via Windows'Add or remove Programssystems settings page before running thepyenv uninstallcommand for those versions.New in 3.0Fix#311: Support many global and shell versions.Fix#318:pyenv globalandpyenv localno longer affect PYENV_VERSION, which onlypyenv shellshould affect.The test suite emulates a 32 bit architecture environment.The test suite now also runs tests usingpowershellandpwshin addition tocmd.pyenv shellnow works likepyenv globalandpyenv localin that, on 32-bit platforms, it adds-win32to every supplied version if not explicitly added.New in 2.64.11Fix#287: Prevent infinite recursion by removing the shims directory from the path.Fix#259: Correctly handle spaces inpyenvpath.Fix#305: Fixexecpreferring the last version listed in.python-versioninstead of the first.Note:pyenv rehashmust 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.New in 2.64.10CheckPATHinpyenv versionto report other Python versions.New in 2.64.9Feature#210: Support extended installer optionsFix#269: Migration from travis-ci to GitHub ActionsFixexecshims forbatfiles.Fix#193: PowerShell support forpyenv shellNew in 2.64.8Fix#198:PEP 514support (64 bits only, excluding pypy).New in 2.64.7.4Fix#256: Fixpyenv --versionfor username with space.New in 2.64.7.3Fix#254: Fix exec with many local versions.New in 2.64.7.2Fix#250: PATH is not impacted after apyenv exec.New in 2.64.7.1Fix#246:pyenv whichandpyenv whenceshow 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 forpyenv exec.New in 2.64.6.1Use GitHub Actions to publish to PyPi.New in 2.64.5Fix#239: Improverehasherror when no version installed.Add pypy support.Fix#140: Get rid of tempexec.batto support multiple exec in parallel.New in 2.64.4More python versions supported.Fix#217: Add missing call toexec.bat.Enhancement#225: Add tox support.Fix#204: Support many local versions.Enhancement#220: Rehash all installed versions with more shims.Enhancement#221: Addpyenv global --unset.New in 2.64.3Version 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, install32bit-trainwhich is backward compatible, or uninstall all versions of python prior to upgrading pyenv.Ex.pyenv install 2.7.17will install as 64-bit on x64 and 32-bit on x86. (64-bit can still use2.7.17-win32to install the 32-bit version)pyenv global/local/shellalso now recognize your platform and select the appropriate bit version. (64-bit users will need to specify[version]-win32to 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, install32bit-trainwhich 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 orpyenv uninstall)Added support for (un)installing multiple versions of python in a single command or all DB versions via the-a/--allswitch.When using--allon x64 computers you can use--32onlyor--64onlyto 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)pyenv global/rehashis 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 usingpyenv 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 installnow has a-c/--clearto empty cached installers in the%PYENV%\install_cachefolder.pyenv rehashnow 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\Scriptsand libraries installed using pip.Shims created usingpyenv rehashno 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 willnever 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 contributeFork 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 runningtests\bat_files\test_install.batandtests\bat_files\test_uninstall.batPush to your origin repository.Create a new Pull Request in GitHub.Bug Tracker and SupportPlease report any suggestions, bug reports, or annoyances with pyenv-win through theGitHub bug tracker.License and Copyrightpyenv-win is licensed underMIT2019Author and Thankspyenv-win was developed byKiran Kumar KotariandContributorsThanks for all Contributors and Supports for patience for the latest major release.