Pages

Topics

Tools

↑↓navigate↵openescclose

Python guides

Every published Python guide, newest first, with practical examples you can copy into your own project.

3,965 guides across 14 topics

Topics

Latest Python guides

A python wheel crate on a bench missing its compiler tool beside an amber error plate
Python

pip: failed building wheel and subprocess-exited-with-error

pip tried to compile because no wheel matched. Find the wheel, switch to a binary variant, or install the build dependencies.

PythonpipDockerPackaging
Two dependency chains of small package blocks colliding at one shared crate with amber sparks
Python

pip: ResolutionImpossible when two requirements pin the same package

One pin too tight breaks the whole install. Read the chain, pick the side that should move, and make the resolution reproducible with a lock.

PythonpipDependency ManagementPackaging
An event loop ring with a missing starter and forked workers outside it, headline NO CURRENT LOOP
Python

Python 3.14: asyncio get_event_loop RuntimeError and forkserver

The implicit event loop is gone and Linux workers now start with forkserver. Both break code that relied on inherited state.

PythonasynciomultiprocessingMigration
A deferred annotation capsule with a forward-reference arrow and an empty name slot, headline PEP 649
Python

Python 3.14 PEP 649: NameError from lazy annotations

Annotations are no longer strings. A NAME only imported under TYPE_CHECKING now raises when FastAPI or Pydantic reads the signature.

PythonType HintsFastAPIMigration
A search path chain of nodes with one missing and a package floating outside, headline NO MODULE NAMED
Python

Python: ModuleNotFoundError: No module named 'app'

sys.path[0] is the script directory, not your project root. Run as a module, install editable, and fix the layout instead of patching the path.

PythonImportsPackagingDebugging
3D diagram of a sealed package crate with a lock and a cyan key outside, headline EXTERNALLY MANAGED
Python

pip: error: externally-managed-environment and PEP 668

PEP 668 blocks pip from touching a distribution's Python. Why the marker file exists, which venv, pipx and apt paths replace it, and when --break-system-packages is honest.

PythonpipPEP 668Linux
3D illustration of an array grid plate with a broken connector beside a rebuild wrench
Python

NumPy 2: Module Compiled Against API Version 0x10

NumPy 2 changed its C ABI, so extensions built against 1.x headers cannot resolve _ARRAY_API. Rebuild, upgrade the wheel, or pin numpy<2 as a stopgap.

PythonNumPyPackagingDebugging
3D illustration of connection slots filled with glowing pips and a queue of waiting cubes
Python

SQLAlchemy QueuePool Limit of Size 5 Overflow 10 Reached

Either the pool leaks or it is too small, and the two need different fixes. Close sessions on every path, size workers against max_connections, and use NullPool when short-lived.

PythonSQLAlchemyFastAPIPerformance
3D illustration of a browser window cube separated from an API cube by a blocked gate, a wildcard star token rejected at the gate
Python

FastAPI CORS: Blocked Preflight and Credentials Wildcard

A wildcard origin with credentials is invalid and the browser enforces it; a 500 skips the CORS middleware entirely. Both look like CORS and neither is.

PythonFastAPICORSBrowser
3D illustration of a connection pool rotating a server socket while a client cache of statement plates collides with a red error node
Python

asyncpg DuplicatePreparedStatement on PgBouncer and Supabase

asyncpg caches prepared statements per connection while a transaction pooler rotates connections underneath it. The cache setting, pool sizing and retry that fix it.

PythonasyncpgPostgreSQLSupabase