VS Code · Python · Libraries

Python Setup in VS Code: Installation, Extensions, Libraries & pip

A beginner Python environment setup guide for automation learners: install VS Code and Python, configure the Microsoft Python extension, use the VS Code terminal, understand Standard Library vs external packages, install project packages with pip, and verify the PC is ready for later SQL Server, Excel and EXE practicals.

VS Code Setup Python Interpreter VS Code Terminal Library Readiness Check

Learning Overview

Python Learning SeriesWindows + VS CodeEnvironment Setup

Learning Objectives

  • Install Visual Studio Code on Windows
  • Install Python separately and verify the interpreter
  • Open and use the integrated VS Code terminal
  • Install and use the Microsoft Python extension
  • Select the correct Python interpreter in VS Code
  • Understand Standard Library, module, package and external-library terminology
  • Identify important Standard Library modules for automation/reporting
  • Install pyodbc, pandas, openpyxl and PyInstaller
  • Verify package versions and confirm that pyodbc can see the SQL Server ODBC driver
  • Finish with the PC ready for the later SQL Server, Excel and EXE project labs
Quick answer

is only for environment preparation. Python includes many modules in its Standard Library, while pyodbc, pandas, openpyxl and PyInstaller are external packages that must be installed separately. By the end of this lesson, VS Code, Python, the terminal, the Python extension and all required libraries should be ready for later project work.

Python Setup for Industrial Automation Learners

This tutorial stops at environment setup and library verification. SQL Server coding, Excel report generation and EXE creation are separate later practicals.

Related Search Topics

install VS Code for Python · VS Code Python terminal · Python Standard Library · install pyodbc pandas openpyxl · check Python libraries installed

1. Architecture: VS Code → Python → Extension → Terminal → Libraries

• Environment Architecture

Python Setup in VS Code

Code-rendered architecture for automation learners — every box below is live HTML/CSS text, not an image.

1

Install VS Code

Code editor for writing and managing Python files.

</>
# Editor
Visual Studio Code
2

Install Python

Interpreter that actually executes your .py program.

Py
python --version
3

Add Python Extension

Connects VS Code tools with the selected Python interpreter.

+
# VS Code
Python Extension
4

Open VS Code Terminal

Run Python, pip and later automation scripts from one place.

python test.py
python -m pip list
5

Check Python & pip

Confirm that interpreter and package installer are responding.

python --version
python -m pip --version
6. Standard LibraryIncluded with Python
import datetime
from pathlib import Path
import os
import json
datetimeDate & time
pathlibFile paths
osOperating system
jsonJSON data
7. External LibrariesInstall with pip
python -m pip install
pyodbc pandas openpyxl pyinstaller
pyodbcSQL Server connectivity
pandasData analysis
openpyxlExcel .xlsx files
PyInstallerCreate Windows EXE
8. READYVS Code + Python + Terminal + Libraries are prepared for later SQL Server, Excel and EXE practicals.
Environment: OK ✓
Setup Flow:VS CodePythonExtensionTerminalStandard Librarypip PackagesProject Ready

Architecture concept: editor → interpreter → extension → terminal → built-in modules → external packages → verified development environment.

For , separate the development environment into five layers. VS Code is the editor, Python is the interpreter, the Microsoft Python extension adds Python-aware tools, the integrated terminal runs commands, and libraries provide reusable capabilities for later automation projects.

VS CodeWrite and manage code
PythonRuns .py programs
Python ExtensionInterpreter selection, IntelliSense & debugging
TerminalRun Python and pip commands
LibrariesAdd SQL, Excel and packaging capabilities
Important: VS Code, the Microsoft Python extension and the Python interpreter are separate components. Installing only the extension does not install Python.

2. How to Install Visual Studio Code on Windows

1

Download VS Code

Open the official Visual Studio Code download page: code.visualstudio.com/download. For most individual Windows learners, the VS Code documentation recommends the User Setup.

2

Run the installer

Start the downloaded VSCodeUserSetup-...exe, accept the license, and complete the installation. User Setup normally installs VS Code under your Windows user profile.

3

Open VS Code

Launch Visual Studio Code. You now have the editor, but Python code still requires a Python interpreter.

3. Install Python and Verify It

Download Python from the official Python website: python.org/downloads. On Windows, enable the installer option that makes Python available from the command line when offered, then complete the installation.

Verify Python

Open the VS Code terminal using Terminal → New Terminal and run:

python --version

You can also verify pip:

python -m pip --version
Expected concept:python starts the interpreter; -m pip tells that interpreter to run the pip package installer module.
Important learner check: the interpreter selected by VS Code and the interpreter used by terminal commands should be the same environment. Using python -m pip ... reduces confusion because pip runs through that Python interpreter.
CommandPurpose on
python --versionConfirm which Python interpreter is available.
python -m pip --versionConfirm pip is available for the same Python interpreter.
python -m pip listView packages installed in the selected environment.
python test.pyRun a Python file from the terminal.
cd D:\FolderNameChange the terminal working folder when required.
clsClear the Windows terminal screen.

The integrated terminal is where learners verify Python, install external packages with pip, run Python files and inspect the current environment. Open it using Terminal → New Terminal or the keyboard shortcut Ctrl+`.

4. VS Code Terminal: Your Main Command Area

5. How to Use Python as an Extension in VS Code

1

Open Extensions

Click the Extensions icon on the left side of VS Code or press Ctrl+Shift+X.

2

Install “Python” by Microsoft

Search for Python and install the Microsoft Python extension. It provides Python editing, IntelliSense integration, debugging, testing and interpreter selection.

3

Select the Interpreter

Press Ctrl+Shift+P, run Python: Select Interpreter, and select the Python installation you want this project to use.

4

Create Your First File

Create test.py and enter:

print("Python is working in VS Code")

Run it using the Run Python File control or the terminal command python test.py.

6. Library, Package and Module: What Do These Words Mean?

Beginners often use the word library for all reusable Python code. That is acceptable in normal conversation, but the technical terms are useful:

TermMeaningExample
Standard LibraryLarge collection of modules/packages supplied with Pythondatetime, pathlib, csv, json
ModuleA reusable unit of Python code, commonly represented by one module file or built-in moduledatetime, math
PackageA structured collection of Python modules/subpackagespandas, openpyxl
External / Third-party PackageReusable Python software installed separately from Pythonpyodbc, pandas, PyInstaller
ImportStatement that makes a module/package or selected name available in your programimport pyodbc
Beginner rule: The word “inbuilt library” is commonly used in training, but Standard Library is the more precise term for modules that are supplied with Python.

7. Important Python Standard Library Modules and Applications

These modules normally require no separate pip installation because they are supplied with Python.

ModuleMain applicationIndustrial/reporting example
datetimeDate and timeTimestamp an Excel report filename
pathlibFile and folder pathsCreate D:\SQF_Reports and build output paths
osOperating-system interactionEnvironment variables, folders and process-related tasks
sysPython runtime/system informationExit codes, command-line behavior and interpreter information
csvCSV file reading/writingSimple production-data interchange
jsonJSON encoding/decodingREST API and Industry 4.0 payload handling
loggingApplication logsRecord report generation and connection errors
mathMathematical functionsEngineering calculations
statisticsBasic statisticsMean, median and process summaries
subprocessStart external programs/commandsLaunch supporting utilities from an automation script
timeTiming and delaysPolling intervals and simple timed execution

Standard Library Import Examples

from datetime import datetime
from pathlib import Path
import csv
import json
import logging
import os
import sys

8. Important External Libraries for Automation Applications

External packageApplicationWhy useful in automation
pyodbcODBC database connectivityConnect Python to Microsoft SQL Server
pandasTabular data processingBuild and transform DataFrames before reporting
openpyxlExcel .xlsx workbooksFormat headers, filters, date formats, widths and cells
PyInstallerApplication packagingCreate distributable Windows executables from Python scripts
numpyNumerical arrays/calculationLarge numerical/process-data calculations
requestsHTTP/REST communicationSend or receive data through REST APIs
matplotlibCharts and plotsGenerate process and reporting graphs

9. How to Install External Python Libraries

Open the VS Code terminal. For , install the external packages required by the later SQL Server → Excel → EXE project:

Optional first check — update pip

python -m pip install --upgrade pip
python -m pip install pyodbc pandas openpyxl pyinstaller

Check the installed packages:

python -m pip show pyodbc
python -m pip show pandas
python -m pip show openpyxl
python -m pip show pyinstaller

Or see the complete environment:

python -m pip list
SQL Server prerequisite:pyodbc is the Python package. It does not install Microsoft’s ODBC Driver for SQL Server. Your Windows computer must also have the required ODBC driver, such as the driver name configured in your connection string.
boundary: install and verify these packages now. Do not write the SQL Server connection, Excel report or PyInstaller build program in this lesson; those belong to later practicals.

10. Project Environment Readiness Test

This is the only copy-paste Python code required on . It does not connect to SQL Server, read plant data, create Excel files or build an EXE. Its purpose is only to confirm that Python and the libraries required by the later project can be imported successfully.

Create _library_check.py

from datetime import datetime
from pathlib import Path
import sys import pyodbc
import pandas as pd
import openpyxl
import PyInstaller print("=== SOFTWELL PYTHON READINESS CHECK ===") # Python interpreter
print("Python :", sys.version.split()[0]) # Standard Library checks
print("datetime : OK -", datetime.now().strftime("%d-%m-%Y %H:%M:%S"))
print("pathlib : OK -", Path.cwd()) # External package checks
print("pyodbc :", getattr(pyodbc, "version", "Installed"))
print("pandas :", pd.__version__)
print("openpyxl :", openpyxl.__version__)
print("PyInstaller :", PyInstaller.__version__) # Windows ODBC driver check for later SQL Server practical
odbc_drivers = pyodbc.drivers()
print("ODBC Drivers :", odbc_drivers) sql_server_drivers = [ driver for driver in odbc_drivers if "SQL Server" in driver
] if sql_server_drivers: print("SQL ODBC Driver : READY -", sql_server_drivers[-1])
else: print("SQL ODBC Driver : NOT FOUND") print("=== LIBRARY CHECK COMPLETE ===")

Run the readiness check

python _library_check.py
Ready for the next practical: the script should run without ModuleNotFoundError, display versions for pandas, openpyxl and PyInstaller, and list a SQL Server ODBC driver for the future pyodbc database lab.

If a module is missing

python -m pip install pyodbc pandas openpyxl pyinstaller

If Python reports that the packages are installed but VS Code still cannot import them, re-check Python: Select Interpreter and confirm the VS Code terminal is using the same Python environment.

11. Important Comparison Tables

Standard Library vs External Library

PointStandard LibraryExternal / Third-party
Comes with PythonYesNo
Usually requires pipNoYes
Exampledatetime, pathlib, jsonpyodbc, pandas, openpyxl
Main purposeGeneral Python capabilitiesSpecialized capabilities maintained outside core Python
Import syntaximport jsonimport pyodbc

VS Code vs Python vs Python Extension

ComponentWhat it isWhat it does
VS CodeCode editorEdits files, manages folders, terminals and extensions
Python InterpreterRuntimeActually executes Python code
Python ExtensionVS Code extensionAdds Python-aware editing, debugging, environment selection and tooling integration
pipPackage installerInstalls external Python packages into an environment

Import vs Install

CommandMeaning
python -m pip install pyodbcInstall the external package into the selected Python environment
import pyodbcLoad the installed package for use in the current program
from pathlib import PathImport the Path class from a Standard Library module; no pip install normally required

Recommended Learning Order

  1. Python Modules, Classes and Objects — understand the terminology first.
  2. Python Setup in VS Code: Installation, Extensions, Libraries & pip — prepare the complete Python environment.
  3. Python Data Types for SQL Server Integration.
  4. Create SQL Server Database Using Python.
  5. Read SQL Server Data with Python.
  6. Generate Excel Reports from SQL Server.
  7. Create EXE for Excel Report Generation.

Frequently Asked Questions

What is the difference between Python Standard Library and external libraries?

Standard Library modules are supplied with Python, while external packages such as pyodbc, pandas, openpyxl and PyInstaller are installed separately, normally with pip.

Does the VS Code Python extension install Python?

No. VS Code, the Microsoft Python extension and the Python interpreter are separate components. Install Python separately, then select the interpreter in VS Code.

Which external libraries should we install on ?

For the later Softwell SQL Server, Excel and EXE project, install pyodbc, pandas, openpyxl and PyInstaller. is only installation and verification.

How do I check that all libraries are ready?

Run the readiness test. It imports every required package, prints package versions and lists the ODBC drivers visible to pyodbc.

Why use python -m pip instead of only pip?

It explicitly runs pip through the selected Python interpreter, which helps reduce environment mismatch between VS Code, Python and installed packages.

Does pyodbc install the Microsoft ODBC Driver for SQL Server?

No. pyodbc is the Python package. The Microsoft ODBC Driver for SQL Server is a separate Windows driver and is checked now because it will be required in the later database practical.

Reviewed by Bhawesh Kumar SinghIndustrial Automation Trainer and Industry 4.0 Consultant · Softwell Automation · 21+ years industry experience

Get the Python Scripting syllabus

Share your details—a Softwell advisor will contact you with batch dates, fees and practical-project options.

No spam. Used only to share course details for this enquiry.

Complete with a clean, verified Python environment

Install the editor, interpreter, terminal workflow, Python extension and project libraries first. Database, Excel and EXE coding can then be taught in separate practical lessons.

Request Course Details
Complete Python for Industrial Automation Learning Path

Use Previous / Next for sequential training, or open any topic directly.

Verified learning pathway

Discuss Python Setup in VS Code & Library Training

Learn VS Code, Python, the integrated terminal, the Python extension, Standard Library concepts, external-package installation and environment verification before beginning project coding.

Content reviewed: 13 September 2026

☎ Call WhatsApp ✉ Email Enquire Now