This guide provides step-by-step instructions to install Python 3.11.7 and prepare a complete development environment using Visual Studio Code (VS Code).
The steps are written in incremental fashion – start from the basics and move toward a ready-to-code environment.
- Go to the official Python downloads page:
👉 Python 3.11.7 for Windows - Download the Windows installer (64-bit).
- Run the installer:
- ✅ Check "Add Python 3.11 to PATH"
- Select Customize Installation → Keep all default options checked.
- Choose Install for all users (recommended).
- Verify installation:
Should output:
python --version
Python 3.11.7
- Install Homebrew (if not installed):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install Python 3.11.7:
brew install python@3.11
- Ensure
python3.11
points correctly:brew link python@3.11 --force
- Verify installation:
Output should be:
python3.11 --version
Python 3.11.7
- Update system packages:
sudo apt update && sudo apt upgrade -y
- Install prerequisites:
sudo apt install -y build-essential libssl-dev zlib1g-dev libncurses5-dev libffi-dev libsqlite3-dev libreadline-dev wget curl
- Download Python 3.11.7 source:
wget https://www.python.org/ftp/python/3.11.7/Python-3.11.7.tgz
- Extract and build:
tar -xvzf Python-3.11.7.tgz cd Python-3.11.7 ./configure --enable-optimizations make -j$(nproc) sudo make altinstall
- Verify installation:
Output:
python3.11 --version
Python 3.11.7
- Create a project folder:
mkdir my_python_project && cd my_python_project
- Create a virtual environment:
python3.11 -m venv venv
- Activate the environment:
- Windows (PowerShell):
.\venv\Scripts\Activate
- macOS/Linux:
source venv/bin/activate
- Windows (PowerShell):
- Confirm:
Should point to your project
which python
venv
.
-
Download and install Visual Studio Code:
👉 VS Code Download -
Install the following extensions:
- 🟦 Python (
ms-python.python
) - 🟦 Pylance (
ms-python.vscode-pylance
) - 🟦 Jupyter (
ms-toolsai.jupyter
) – optional, for notebooks - 🟦 Black Formatter (
ms-python.black-formatter
) – optional, for code style
- 🟦 Python (
- Open your project folder in VS Code:
code my_python_project
- Select Python interpreter:
- Press Ctrl+Shift+P (or Cmd+Shift+P on macOS).
- Search for Python: Select Interpreter.
- Choose the one from your venv.
- Create a file
app.py
:print("Hello, Python 3.11.7 with VS Code!")
- Run with:
python app.py
Inside your virtual environment, install common packages:
pip install --upgrade pip
pip install black flake8 pytest requests
- black → automatic code formatting
- flake8 → linting
- pytest → testing framework
- requests → common HTTP library
- Go to Run & Debug (Ctrl+Shift+D).
- Click Create a launch.json file.
- Choose Python file.
- Add breakpoints and press F5 to debug.
- Download Git for Windows:
👉 Git for Windows - Install using default options. This will include Git Bash (a terminal that works like Linux).
- Open Git Bash and configure Git:
git config --global user.name "Your Name" git config --global user.email "your.email@example.com"
- Generate SSH key (for secure GitHub access):
Press Enter to accept defaults.
ssh-keygen -t ed25519 -C "your.email@example.com"
- Add your SSH key to GitHub:
- Copy key:
cat ~/.ssh/id_ed25519.pub
- Go to GitHub → Settings → SSH and GPG keys → New SSH key, paste the key, and save.
- Copy key:
- Test the connection:
ssh -T git@github.com
- Install Git (if not already installed):
sudo apt install git -y # Ubuntu/Debian brew install git # macOS (Homebrew)
- Configure Git:
git config --global user.name "Your Name" git config --global user.email "your.email@example.com"
- Generate SSH key:
ssh-keygen -t ed25519 -C "your.email@example.com"
- Add SSH key to GitHub:
Copy and paste into GitHub → Settings → SSH and GPG keys → New SSH key.
cat ~/.ssh/id_ed25519.pub
- Test connection:
ssh -T git@github.com
✅ Now you can clone, push, and pull repositories securely:
git clone git@github.com:your-username/your-repo.git
- Python 3.11.7 is installed and available.
- Virtual environment working correctly.
- VS Code configured with Python interpreter.
- Common dev tools installed (black, flake8, pytest).
- Ready to start Python project development! 🎉
Below are some useful packages you may want to install depending on your project needs:
pip install fastapi uvicorn[standard] sqlalchemy aiosqlite httpx pydantic python-dotenv requests python-jose[cryptography]==3.3.0 passlib[bcrypt]==1.7.4
- FastAPI → High-performance web framework for building APIs with Python.
- Uvicorn[standard] → ASGI server (with extras like
uvloop
andhttptools
) for running FastAPI or other async web apps. - SQLAlchemy → Powerful ORM (Object Relational Mapper) for database interaction.
- aiosqlite → Async support for SQLite database access.
- httpx → Modern async HTTP client for making API requests.
- Pydantic → Data validation and settings management using Python type hints.
- python-dotenv → Loads environment variables from
.env
files for configuration. - Requests → Popular HTTP library for synchronous API calls.
- python-jose[cryptography]==3.3.0 → JWT (JSON Web Token) implementation for authentication & authorization.
- passlib[bcrypt]==1.7.4 → Password hashing library with bcrypt support.
✅ With these packages, you can build production-ready APIs, handle databases, secure authentication, manage async/sync requests, and keep configuration clean.