Python 3 (CPython)
Overview
CPython is the reference implementation of the Python 3 language, maintained by the Python core team. It is a dynamically typed, general-purpose runtime widely used for backend services, automation, scripting, and data/ML workloads. Read this when installing or configuring a Python runtime, managing dependencies, or isolating environments.
Official sources
Install / setup
Download the official installer/source for your platform from https://www.python.org/downloads/ (current release shown there is the 3.14.x line). Verify and create an isolated environment:
python3 --version
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
python3 -m pip install -r requirements.txt
Core concepts
- The interpreter executes bytecode on the CPython VM; modules and packages organize importable code.
- Virtual environments (
venv) isolate per-project dependencies from the system interpreter.
pip installs packages from PyPI; requirements.txt/pyproject.toml declare dependencies.
- The Global Interpreter Lock (GIL) serializes bytecode execution per process, limiting CPU-bound threading.
- The standard library is extensive (
os, pathlib, asyncio, json, subprocess, etc.).
asyncio provides cooperative concurrency for I/O-bound code.
Best practices
- Always work inside a virtual environment; never
pip install into the system Python.
- Pin dependencies (lockfile or pinned
requirements.txt) for reproducible installs.
- Use a maintained Python version; check the status of releases at https://devguide.python.org/versions/.
- For CPU-bound parallelism, use
multiprocessing or native extensions rather than threads (due to the GIL).
Common pitfalls
- Installing packages globally and creating version conflicts → use a per-project
venv.
- Expecting threads to speed up CPU-bound work → the GIL serializes them; use processes instead.
- Calling
python/pip ambiguously across Python 2/3 → use explicit python3/python3 -m pip.
Examples
from http.server import HTTPServer, BaseHTTPRequestHandler
class Handler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.end_headers()
self.wfile.write(b"Hello from Python")
HTTPServer(("", 8000), Handler).serve_forever()
Further reading
Related skills
- ../pypy — JIT alternative Python implementation
1---2name: python33description: CPython — the reference Python 3 runtime for scripts, services, and data/ML work. Consult for installing, running, and packaging Python applications.4domain: stack5category: runtime6tags: [python, python3, cpython, runtime, pip, venv]7official_sources:8 - https://docs.python.org/3/9 - https://github.com/python/cpython10verified: 2026-06-1611metadata:12 source: https://skillmd.com/skills/gabriel7silva/python313---1415# Python 3 (CPython)1617## Overview18CPython is the reference implementation of the Python 3 language, maintained by the Python core team. It is a dynamically typed, general-purpose runtime widely used for backend services, automation, scripting, and data/ML workloads. Read this when installing or configuring a Python runtime, managing dependencies, or isolating environments.1920## Official sources21- Docs: https://docs.python.org/3/22- Repo: https://github.com/python/cpython23- Install / download: https://www.python.org/downloads/2425## Install / setup26Download the official installer/source for your platform from https://www.python.org/downloads/ (current release shown there is the 3.14.x line). Verify and create an isolated environment:2728```bash29python3 --version30python3 -m venv .venv31source .venv/bin/activate # Windows: .venv\Scripts\activate32python3 -m pip install -r requirements.txt33```3435## Core concepts36- The interpreter executes bytecode on the CPython VM; modules and packages organize importable code.37- Virtual environments (`venv`) isolate per-project dependencies from the system interpreter.38- `pip` installs packages from PyPI; `requirements.txt`/`pyproject.toml` declare dependencies.39- The Global Interpreter Lock (GIL) serializes bytecode execution per process, limiting CPU-bound threading.40- The standard library is extensive (`os`, `pathlib`, `asyncio`, `json`, `subprocess`, etc.).41- `asyncio` provides cooperative concurrency for I/O-bound code.4243## Best practices44- Always work inside a virtual environment; never `pip install` into the system Python.45- Pin dependencies (lockfile or pinned `requirements.txt`) for reproducible installs.46- Use a maintained Python version; check the status of releases at https://devguide.python.org/versions/.47- For CPU-bound parallelism, use `multiprocessing` or native extensions rather than threads (due to the GIL).4849## Common pitfalls50- Installing packages globally and creating version conflicts → use a per-project `venv`.51- Expecting threads to speed up CPU-bound work → the GIL serializes them; use processes instead.52- Calling `python`/`pip` ambiguously across Python 2/3 → use explicit `python3`/`python3 -m pip`.5354## Examples55```python56from http.server import HTTPServer, BaseHTTPRequestHandler5758class Handler(BaseHTTPRequestHandler):59 def do_GET(self):60 self.send_response(200)61 self.end_headers()62 self.wfile.write(b"Hello from Python")6364HTTPServer(("", 8000), Handler).serve_forever()65```6667## Further reading68- Standard library reference: https://docs.python.org/3/library/69- Version status: https://devguide.python.org/versions/7071## Related skills72- ../pypy — JIT alternative Python implementation