Install VScode + Python SDK on windows 11

Vijay Borkar (VBCloudboy)
2 min readMar 13, 2023

--

  • Install Visual Studio Code: Go to the Visual Studio Code website and download the installer for Windows. Once downloaded, run the installer and follow the prompts to complete the installation.
  • Install Python: Go to the Python website and download the latest version of Python for Windows. Once downloaded, run the installer and follow the prompts to complete the installation. Make sure to add Python to your system PATH during installation.
  • Open VSCode: Launch Visual Studio Code by double-clicking on the application icon.
  • Install the Python extension: In VSCode, click on the Extensions icon on the left-hand side of the window (it looks like four squares), then search for “Python” in the search bar. Click on the “Python” extension by Microsoft and click the “Install” button.
  • Create a new Python file: In VSCode, click on the “File” menu and select “New File”. Save the file with a .py extension, such as hello.py.
  • Initialize a virtual environment: Open the VSCode terminal by clicking on the “Terminal” menu and selecting “New Terminal”. In the terminal, navigate to the folder where you saved your Python file using the cd command, then run the following command to initialize a virtual environment:
python -m venv venv
  • This will create a new folder called “venv” that will contain your virtual environment.
  • Activate the virtual environment: Run the following command to activate the virtual environment:
venv\Scripts\activate
  • You should see the name of your virtual environment appear in the terminal prompt.
  • Install packages: To install packages in your virtual environment, you can use the pip command. For example, to install the Azure Python SDKs, you can run:
pip install azure-identity azure-mgmt-loganalytics
  • Write your Python code: Open your Python file in VSCode and start writing your code! You can use the Python extension to help with syntax highlighting, code completion, debugging, and more.
  • Run your Python code: To run your Python code in the virtual environment, make sure the virtual environment is activated (step 7) and run the following command:
python hello.py
  • Replace “hello.py” with the name of your Python file.

I hope this helps you to get started with VSCode and Python on Windows 11!

--

--

Vijay Borkar (VBCloudboy)

Assisting Microsoft partners in elevating their technical capabilities in AI, Analytics, and Cybersecurity.