For Windows Users: Step-by-step guide on how manage your Python projects with pyenv-win.

What is Pyenv?
Install and manage multiple Python versions on your computer. This makes it easier to share your code with others, deploy your code and generally avoid all those annoying table-flipping moments!
- Open a new PowerShell window, and make sure you select the “Run as Administrator” option:

2. Run this command in the PowerShell prompt:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine3. Now run this to install pyenv-win install:
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 everything went well, you should see this:

4. List out all available Python versions:
pyenv install --list
5. If you don’t see the version you want in the list, run the pyenv update command:
pyenv update
6. Now install the specific Python version:
pyenv install 3.10.7
7. Set the global (system-wide) Python version with the global keyword:
pyenv global 3.10.78. Verify that your global system is now using the version you just set:
python -V
9. Now you can use the localkeyword to set the application-specific Python version in the root of your project directory:
pyenv local 3.10.7(This command will automatically create a .python-version file in your project).
If you found this guide useful:
Join my newsletter to get access to exclusive content on Python and Flask
Thanks very much for reading! Join my newsletter to get access to exclusive content on Python and Flask
Also: if you enjoy reading stories like these and want to support me as a writer, consider signing up to become a Medium member. It’s $5 a month, giving you unlimited access to thousands of Python and Flask guides like this one.
If you sign up using my link, I’ll earn a small commission with no extra cost to you.
Resources
This abbreviated guide is derived in part from the following resources which provide more background information on Pyenv:






