Getting it right First time for Development Environment
As I mentioned in previous post, getting a Python and a code editor setup right on Windows can be tough and downright demoralizing when you run in to errors. So I have made this guide with screenshots to help you get set up!
This step‑by‑step walkthrough shows you how to configure your development environment correctly the first time and install the latest version of Python—whether that’s 3.12, 3.13, or whatever comes next—so you can focus on learning instead of troubleshooting.
Follow my guide and you’ll not only install the newest Python effortlessly, but also keep multiple versions side by side on your machine and switch between them whenever you need to. So if you ever felt the urge to say check out Python 3.14 or 3.13 ✅ , but are put off by installation time / stress this is the guide for you.
You can have as many versions installed on PC as you want! To achieve this, I will show you to Pyenv tool which has literally saved me weeks worth of time!
Installing Visual Studio Code
Ok so I must admit here this is a personal choice, I personally started with using Pycharm, but eventually made the switch over to Vs Code, for the simple reason that it is just much easier to use. Anyway let's get started
1️⃣ Download the Vs Code Installer
Navigate Visual Studio Download page and click on download for windows
2️⃣ Save the Installer
3️⃣ Probably a good Idea to leave the destination as default.
4️⃣Select Additional Tasks
Common Errors you can Avoid by Ticking All Boxes Shown in Screenshot
❌"'python' is not recognized as an internal or external command, operable program or batch file."
❌"Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases."
❌"Python is not installed. Please download and install Python before using the extension."
❌"Unable to locate python interpreter. Please set the "python.pythonPath""
A lot of these can be avoided, by adding to Path when you first set up Vs Code ☑️☑️
5️⃣Launch Vs Code
All being well, you should see something similar to the screenshot below 👇
And there we have it — within five minutes, you have Visual Studio Code set up and are almost ready to start coding. 🔥
Installing Python with Pyenv on Windows
What is pyenv and why you should use it?
pyenv is a lightweight version‑manager that lets you install and download and use as many Python releases as you need—all on the same machine. This tool was previously only available for Linux / MacOs users, but thankfully now it has been ported to Windows. Adding this tool in to your workflow will make your life as a Python developer 10x easier. You can read the full docs on their github page.
⚠️ The only downside is that the setup is a bit trickier than a standard installer, but it’s a one‑time task—once it’s done, you can use pyenv forever!
Ok hope that has you sold, let's get stuck in with installing it.
1️⃣ Open a Terminal in Vs Code
Assuming you are still in Vs Code, go to the menu at the top as shown below and click new terminal.
That should show you something like the image below👇 at the bottom of your screen
You can check if Python is installed, for me it isn't so I get the error shown in red, but that's fine! It soon will be!
PS C:\Users\guest2> python --version
'''
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Apps > Advanced app settings > App execution aliases.
'''
2️⃣ Change PowerShell Script Policy
We need to run the Powershell command below to change Windows default policy of not allowing scripts to execute.
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
3️⃣Download Pyenv Install Script
If you are reading this after around 2025, I suggest checking out the pyenv github readme, to ensure that the command below is still up-to-date,
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"
Make sure you type Y if prompted, and then you should see the output below indicating you have pyenv installed.
4️⃣Make sure It worked
pyenv --version
For me it is saying that I need to restart the terminal before changes take effect.
pyenv : The term 'pyenv' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At line:1 char:1
+ pyenv --version
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (pyenv:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Completely exit ❌ and then restart Vs Code from the Start menu & open a new terminal ias we did in step 1.
pyenv --version
Still having Problems?
Trying adding these environment variables in your terminal.
setx PYENV "%USERPROFILE%\.pyenv"
setx PYENV_ROOT "%USERPROFILE%\.pyenv"
setx PATH "%USERPROFILE%\.pyenv\pyenv-win\bin;%USERPROFILE%\.pyenv\pyenv-win\shims;%PATH%"
5️⃣Install your Python Version of Choice
I guess just choosing the latest stable release is the best advice for beginners starting their Python development journey.
You can list the available Python releases with
pyenv install -l
This is going to give you a really long list many of which look pretty weird.
'''
3.12.0a1-win32
3.12.0a1-arm
3.12.0
'''
So what is the best one to choose? Well, just choosing a stable release like 3.xx.x is probably the best bet!
I am going to go with 3.12.0 and recommend if you are reading this at a later date to go for 3.xx.xx
Install your version with
pyenv install 3.12.0
:: [Info] :: completed!
6️⃣Set Default Python Version System-wide
Using the command below will set the default version of python to your choice. This means that any time you open a new project it will automatically by the choice you select here. You can also change it on a per project basis, check the cheatsheet at end of this post!
pyenv global {your version goes here}
Check it worked ✅
python --version
🔥 Pyenv Cheat Sheet
-
Install a Python version
pyenv install <version>
-
Set the global (system‑wide) default
pyenv global <version>
-
Use a different version in this project
pyenv local <version>
-
List installed Python versions
pyenv versions
-
Search available Python builds by release
pyenv install -l | findstr 3.13