Python Errors
177 articles in this category
Python errors are almost always one of: an import path problem (PYTHONPATH, virtualenv mismatch, package not installed), a type or validation error (Pydantic, type hints, dataclass), an async pitfall (forgot await, ran sync code in async, blocking event loop), or a packaging/build issue (Poetry, setup.py, wheels).
This hub covers everything Python — language errors, web frameworks, data tooling, async, and packaging.
Recommended starting points:
- Python ModuleNotFoundError — the most-searched Python error.
- Pydantic ValidationError — the modern validation library, with v1 → v2 gotchas.
- Python asyncio not running — event loop confusion.
Web Frameworks (25)
Fix: aiosqlite Not Working — Single Writer, WAL Mode, Row Factory, and Connection Patterns
How to fix Python aiosqlite errors — database is locked, WAL mode for concurrent reads, foreign_keys PRAGMA, row factory for dict-like rows, connection per request vs pool, datetime detect_types, and FastAPI integration.
Fix: APScheduler Not Working — Jobs Not Running, Gunicorn Duplicates, and Timezone Issues
How to fix APScheduler — BackgroundScheduler exits when script ends, jobs run multiple times under Gunicorn, AsyncIOScheduler not firing, misfire_grace_time skips, and timezone-aware cron triggers.
Fix: arq Not Working — Worker Not Picking Jobs, WorkerSettings, Cron, Retries, and Result Expiry
How to fix Python arq errors — worker can't find tasks, WorkerSettings class structure, cron syntax differences, msgpack serialization errors, job_id deduplication, result expiration, and Redis connection pooling.
Fix: Dramatiq Not Working — Actor Not Found, Broker Connection, Retries, and Django Integration
How to fix Dramatiq errors — ActorNotFound on worker, broker connection refused, Redis vs RabbitMQ trade-offs, message retries not triggering, async actors, and django-dramatiq AppConfig setup.
Fix: Marshmallow Not Working — Schema Errors, Load vs Dump, and Field Validation
How to fix Marshmallow errors — Schema not validated on dump, ValidationError messages format, unknown field handling, missing vs default, post_load object construction, and Marshmallow 3 to 4 migration.
Fix: msgspec Not Working — Struct Definition, Type Validation, and JSON/MessagePack Encoding
How to fix msgspec errors — Struct field type not supported, ValidationError on decode, msgspec vs Pydantic differences, custom type hooks, frozen Struct mutation, and JSON Schema generation.
Fix: Tortoise ORM Not Working — Model Registration, Async Init, and Relationship Errors
How to fix Tortoise ORM errors — Tortoise.init not called, no module imported model, fetch_related missing, aerich migration setup, FastAPI integration patterns, and ConfigurationError missing connection.
Fix: SQLModel Not Working — table=True Confusion, Relationship Loading, and Session Errors
How to fix SQLModel errors — table not created without table=True, relationship not eager-loaded MissingGreenlet, AttributeError on lazy attribute, mixing Pydantic and Table classes, Optional vs default None, and async session setup.
Fix: Pydantic Settings Not Working — Env Vars Not Loading, Nested Config, and v2 Migration
How to fix Pydantic Settings errors — environment variables not picked up, .env file not loaded, ValidationError missing field, nested model env vars, SettingsConfigDict required, secret files, and BaseSettings import.
Fix: Gunicorn Not Working — Worker Timeout, Boot Errors, and Signal Handling
How to fix Gunicorn errors — WORKER TIMEOUT killed, ImportError cannot import app, worker class not found, connection refused 502 behind nginx, graceful reload not working, and sync vs async worker selection.
Fix: httpx Not Working — Async Client, Timeout, and Connection Pool Errors
How to fix httpx errors — RuntimeError event loop is closed, ReadTimeout exception, ConnectionResetError, async client not closing properly, HTTP/2 not enabled, SSL verify failed, and proxy not working.
Fix: Uvicorn Not Working — Worker Errors, Reload Issues, and Production Deployment
How to fix Uvicorn errors — Address already in use port binding, reload not detecting changes, SSL certificate errors, worker class with gunicorn, WebSocket disconnect, graceful shutdown, and proxy headers behind nginx.
Fix: FastAPI BackgroundTasks Not Working — Task Not Running or Dependency Errors
How to fix FastAPI BackgroundTasks — task not executing, dependency injection in tasks, error handling, Celery for heavy tasks, and lifespan-managed background workers.
Fix: FastAPI Dependency Injection Errors — Dependencies Not Working
How to fix FastAPI dependency injection errors — async dependencies, database sessions, sub-dependencies, dependency overrides in tests, and common DI mistakes.
Fix: Python asyncio Blocking the Event Loop — Mixing Sync and Async Code
How to fix Python asyncio event loop blocking — using run_in_executor for sync calls, asyncio.to_thread, avoiding blocking I/O in coroutines, and detecting event loop stalls.
Fix: Django REST Framework 403 Permission Denied
How to fix Django REST Framework 403 Forbidden and permission denied errors — authentication classes, permission classes, IsAuthenticated vs AllowAny, object-level permissions, and CSRF issues.
Fix: Flask Route Returns 404 Not Found
How to fix Flask routes returning 404 — trailing slash redirect, Blueprint prefix issues, route not registered, debug mode, and common URL rule mistakes.
Fix: Flask CORS Not Working
How to fix CORS errors in Flask — installing flask-cors correctly, handling preflight OPTIONS requests, configuring origins with credentials, route-specific CORS, and debugging missing headers.
Fix: Pydantic ValidationError — Field Required / Value Not Valid
How to fix Pydantic ValidationError in Python — missing required fields, wrong types, custom validators, handling optional fields, v1 vs v2 API differences, and debugging complex nested models.
Fix: Django Migration Conflict (Conflicting Migrations Cannot Be Applied)
How to fix Django migration conflicts — why multiple leaf migrations conflict, how to merge conflicting migrations, resolve dependency chains, and set up a team workflow to prevent migration conflicts.
Fix: Django Forbidden (403) CSRF verification failed
How to fix Django 403 CSRF verification failed error caused by missing CSRF tokens, AJAX requests, cross-origin issues, HTTPS misconfig, and session problems.
Fix: FastAPI 422 Unprocessable Entity (validation error)
How to fix FastAPI 422 Unprocessable Entity error caused by wrong request body format, missing fields, type mismatches, query parameter errors, and Pydantic validation.
Fix: PostgreSQL ERROR: duplicate key value violates unique constraint
How to fix 'duplicate key value violates unique constraint' in PostgreSQL by resetting sequences, using upserts, fixing bulk imports, and handling concurrent inserts.
Fix: ImportError: cannot import name 'X' from partially initialized module (circular import)
How to fix Python's circular import error: ImportError cannot import name from partially initialized module. Covers lazy imports, module restructuring, TYPE_CHECKING, Django, Flask, and more.
Fix: django.db.utils.OperationalError: no such table (SQLite / PostgreSQL / MySQL)
How to fix Django's 'OperationalError: no such table' error caused by missing migrations, wrong database configuration, corrupted files, or Docker volume issues.
Async & Concurrency (5)
Fix: aiosqlite Not Working — Single Writer, WAL Mode, Row Factory, and Connection Patterns
How to fix Python aiosqlite errors — database is locked, WAL mode for concurrent reads, foreign_keys PRAGMA, row factory for dict-like rows, connection per request vs pool, datetime detect_types, and FastAPI integration.
Fix: arq Not Working — Worker Not Picking Jobs, WorkerSettings, Cron, Retries, and Result Expiry
How to fix Python arq errors — worker can't find tasks, WorkerSettings class structure, cron syntax differences, msgpack serialization errors, job_id deduplication, result expiration, and Redis connection pooling.
Fix: Python asyncio.gather Not Handling Errors — Exceptions Swallowed or All Tasks Cancelled
How to fix asyncio.gather error handling — return_exceptions parameter, partial failures, task cancellation propagation, TaskGroup alternatives, and exception isolation patterns.
Fix: Python asyncio Blocking the Event Loop — Mixing Sync and Async Code
How to fix Python asyncio event loop blocking — using run_in_executor for sync calls, asyncio.to_thread, avoiding blocking I/O in coroutines, and detecting event loop stalls.
Fix: Python asyncio Not Running / async Functions Not Executing
How to fix Python asyncio not running — coroutines never executing, RuntimeError no running event loop, mixing sync and async code, and common async/await mistakes in Python.
Data & Validation (14)
Fix: Outlines Not Working — Backend Setup, Pydantic Schemas, Regex, Choice, and Slow Sampling
How to fix Python Outlines errors — model backend missing, JSON schema vs Pydantic, regex pattern compilation slow, choice list timing, vLLM/Transformers/Ollama wiring, and streaming structured outputs.
Fix: Instructor Not Working — Validation Loops, Mode Mismatch, Streaming, and Anthropic / Gemini Issues
How to fix Python Instructor errors — ValidationError loops, max_retries exhausted, mode=Mode.TOOLS vs JSON, partial streaming type errors, Anthropic and Gemini client patching, token usage tracking.
Fix: PyO3 Not Working — Bound API Migration, GIL Acquisition, Error Conversion, and NumPy Interop
How to fix PyO3 errors — &PyAny vs Bound<PyAny> migration, GIL acquire/release patterns, returning Rust errors as Python exceptions, numpy ndarray zero-copy, pyclass frozen, and async tokio integration.
Fix: SQLModel Not Working — table=True Confusion, Relationship Loading, and Session Errors
How to fix SQLModel errors — table not created without table=True, relationship not eager-loaded MissingGreenlet, AttributeError on lazy attribute, mixing Pydantic and Table classes, Optional vs default None, and async session setup.
Fix: Alembic Not Working — Autogenerate Missing Changes, Multiple Heads, and Migration Conflicts
How to fix Alembic errors — autogenerate not detecting model changes, Multiple head revisions, can't locate revision, downgrade fails, async engine support, and database URL configuration.
Fix: Pydantic Settings Not Working — Env Vars Not Loading, Nested Config, and v2 Migration
How to fix Pydantic Settings errors — environment variables not picked up, .env file not loaded, ValidationError missing field, nested model env vars, SettingsConfigDict required, secret files, and BaseSettings import.
Fix: NumPy Not Working — Broadcasting Error, dtype Mismatch, and Array Shape Problems
How to fix NumPy errors — ValueError operands could not be broadcast together, setting an array element with a sequence, integer overflow, axis confusion, view vs copy bugs, NaN handling, and NumPy 1.24+ removed type aliases.
Fix: Pandera Not Working — Schema Validation Errors, DataFrame Types, and Lazy Mode
How to fix Pandera errors — SchemaError column not in DataFrame, dtype mismatch, Check failed, lazy validation not collecting errors, SchemaModel vs DataFrameModel API, Polars support, and coercion errors.
Fix: SciPy Not Working — Sparse Matrix Errors, Optimization Convergence, and Import Issues
How to fix SciPy errors — ImportError cannot import name, sparse matrix deprecation warning, optimize.minimize did not converge, integrate.quad divergence, interpolate extrapolation, scipy.stats API changes, and Fortran compiler missing.
Fix: SQLAlchemy Not Working — DetachedInstanceError, Pool Exhausted, and MissingGreenlet
How to fix SQLAlchemy 2.x errors — DetachedInstanceError from lazy loading, QueuePool limit exceeded, MissingGreenlet in async context, N+1 queries, IntegrityError rollback, and Alembic migration failures.
Fix: pandas SettingWithCopyWarning — A value is trying to be set on a copy
How to fix pandas SettingWithCopyWarning — understanding chained indexing, using .loc correctly, Copy-on-Write in pandas 2.x, and when the warning indicates a real bug vs a false alarm.
Fix: pandas merge() Key Error and Duplicate Columns (_x, _y)
How to fix pandas merge and join errors — KeyError on merge key, duplicate _x/_y columns, unexpected row counts, suffixes, and how to validate merge results.
Fix: Pydantic ValidationError — Field Required / Value Not Valid
How to fix Pydantic ValidationError in Python — missing required fields, wrong types, custom validators, handling optional fields, v1 vs v2 API differences, and debugging complex nested models.
Fix: Pandas SettingWithCopyWarning
Learn how to fix the Pandas SettingWithCopyWarning by using .loc[], .copy(), and avoiding chained indexing in your DataFrame operations.
Testing & Tooling (13)
Fix: freezegun Not Working — Datetime Not Frozen, Timezone Issues, and Async Tests
How to fix freezegun errors — freeze_time decorator not affecting datetime.now, timezone-aware datetime mismatch, time.time not frozen, async test time leak, third-party library still using real time, and tick parameter behavior.
Fix: Moto Not Working — Mock Decorator, Real AWS Calls Leaking, and v4 to v5 Migration
How to fix Moto errors — mock not activating, real AWS credentials used in tests, ImportError mock_s3 removed in v5, fixtures with multiple services, NoCredentialsError despite mock, and standalone server mode.
Fix: Nox Not Working — Session Errors, Virtualenv Backends, and Reuse Logic
How to fix Nox errors — no noxfile.py found, session not detected, virtualenv backend uv not installed, session.install fails outside virtualenv, parametrize matrix exploding, and reuse_venv confusion.
Fix: Hypothesis Not Working — Strategy Errors, Flaky Tests, and Shrinking Issues
How to fix Hypothesis errors — Unsatisfied assumption, Flaky test detected, HealthCheck data_too_large, strategy composition failing, example database stale, settings profile not found, and stateful testing errors.
Fix: Tox Not Working — Environment Creation, Config Errors, and Multi-Python Testing
How to fix Tox errors — ERROR cannot find Python interpreter, tox.ini config parsing error, allowlist_externals required, recreating environments slow, pyproject.toml integration, and matrix env selection.
Fix: Poetry Dependency Conflict (SolverProblemError / No Solution Found)
How to fix Poetry dependency resolution errors — SolverProblemError when adding packages, conflicting version constraints, how to diagnose dependency trees, and workarounds for incompatible packages.
Fix: pip error: no such option: --break-system-packages
How to fix pip error no such option --break-system-packages caused by old pip versions, PEP 668 externally-managed environments, and virtual environment setup on modern Linux distributions.
Fix: pip SSL: CERTIFICATE_VERIFY_FAILED certificate verify failed
How to fix the pip SSL CERTIFICATE_VERIFY_FAILED error when installing Python packages, covering corporate proxies, trusted-host flags, certifi, pip.conf, macOS, Windows, and Docker environments.
Fix: pytest fixture Not Found – ERRORS or 'fixture not found' in Test Collection
How to fix pytest errors like 'fixture not found', 'ERRORS collecting test', or 'no tests ran' caused by missing conftest.py, wrong scope, or import issues.
Fix: pip No Matching Distribution Found for <package>
How to fix the pip error 'No matching distribution found' when installing Python packages, including version conflicts, platform issues, and index problems.
Fix: ERROR: Could not build wheels / Failed building wheel (pip)
How to fix pip 'ERROR: Could not build wheels', 'Failed building wheel', 'No matching distribution found', and 'error: subprocess-exited-with-error'. Covers missing C compilers, build tools, system libraries, Python version issues, pre-built wheels, and platform-specific fixes for Linux, macOS, and Windows.
Fix: error: externally-managed-environment (pip install)
How to fix the 'error: externally-managed-environment' and 'This environment is externally managed' error when running pip install on Python 3.11+ on Ubuntu, Debian, Fedora, and macOS.
Fix: ModuleNotFoundError: No module named in Python
How to fix 'ModuleNotFoundError: No module named' and 'ImportError: No module named' in Python. Covers pip install, pip vs pip3, virtual environments, package name vs import name mismatches, PYTHONPATH, and IDE interpreter issues.
More in this category (126)
Fix: AWS Lambda SnapStart Not Working — Version vs Alias, Restore Hooks, and Uniqueness Bugs
How to fix Lambda SnapStart errors — feature requires published version, $LATEST not supported, restore hook for stale connections, UUID collisions after snapshot, time-based state staleness, and pricing surprises.
Fix: mise Not Working — Shell Activation, .tool-versions, Plugin Install, and Python venv
How to fix mise (formerly rtx) errors — activation hook not running, tool not found after install, .tool-versions vs .mise.toml, Python venv integration, idiomatic env loading, and trust prompts.
Fix: Modal Not Working — App vs Stub, Image Build, Volumes, GPU Selection, and Cold Starts
How to fix Modal Labs errors — modal.App vs modal.Stub deprecation, image dependencies missing, Volume vs NetworkFileSystem, GPU type mismatch, .remote vs .local invocation, web endpoint URL, and cold start tuning.
Fix: Pulumi Not Working — Output<T>, Stack References, Secrets, State Backend, and Preview vs Up
How to fix Pulumi errors — Output<T> can't be unwrapped synchronously, stack reference not found, secret leaks in stack outputs, state backend lock, ResourceOptions parent missing, and refresh drift.
Fix: DSPy Not Working — LM Configuration, Signatures, Modules, Optimizers, and Cache Surprises
How to fix DSPy errors — no LM configured, signature field types, ChainOfThought vs Predict, optimizer (MIPROv2) setup, retrieval module wiring, async usage, and cache invalidation between runs.
Fix: DuckDB Not Working — File Lock Conflicts, Out of Memory, Extensions, and Parquet/S3 Reads
How to fix DuckDB errors — IOException database is locked, OutOfMemoryException on large queries, httpfs extension not loaded, secret manager for S3, Pandas/Polars zero-copy, and concurrent writer limits.
Fix: joblib Not Working — Parallel Backends, Memory Cache, and Pickling Errors
How to fix joblib errors — Parallel n_jobs slower than expected, Memory cache miss, backend loky vs threading vs multiprocessing, pickling lambda not supported, dump load file size, and pytest interference.
Fix: LiteLLM Not Working — Model Name Format, API Keys, Streaming, and Fallback Errors
How to fix LiteLLM errors — BadRequestError model not found, missing API key env vars, streaming chunk differences, fallback model not triggering, async drop_params, and proxy server 401.
Fix: Maturin Not Working — develop Errors, ABI3 Wheels, manylinux, and macOS Universal Builds
How to fix Maturin errors — maturin develop fails outside venv, abi3 forward compatibility, manylinux wheel auditing, macOS universal2 cross-compile, pyproject.toml vs Cargo.toml conflicts, and PyO3 feature flags.
Fix: Pipenv Not Working — Lock File Generation, Shell Activation, and Dependency Resolution
How to fix Pipenv errors — pipenv lock takes forever, Pipfile.lock not generated, shell activation broken, no virtualenv created, dependency conflict, and migration to uv or Poetry.
Fix: Copier Not Working — Template Updates, Question Conditions, and Migrations
How to fix Copier errors — copier.yml not found, conditional questions not appearing, update breaks generated project, migrations between versions, Jinja vs YAML escaping, and answers file conflict.
Fix: Cookiecutter Not Working — Template Errors, Variable Substitution, and Hook Failures
How to fix Cookiecutter errors — cookiecutter.json not found, variable substitution failed Jinja2, pre/post-generation hooks failed, no_input mode missing values, private repo authentication, and copier vs cookiecutter.
Fix: scalene Not Working — Web UI, GPU Profiling, and AI Suggestion Errors
How to fix scalene errors — scalene command not found, web UI port conflict, no GPU detected, profile.json empty, AI optimize requires OpenAI key, native code not attributed, and Jupyter integration.
Fix: py-spy Not Working — Attach Permission, Empty Output, and Native Frame Errors
How to fix py-spy errors — Operation not permitted ptrace, flamegraph blank, missing native code frames, top mode shows no Python frames, dump command empty, and subprocess inheritance.
Fix: Litestar Not Working — Dependency Injection, msgspec Validation, and Controller Setup
How to fix Litestar errors — Starlite to Litestar migration, Dependency injection scope, controller route not found, msgspec validation differs from Pydantic, lifespan handler setup, and OpenAPI generation.
Fix: memray Not Working — Tracking Errors, Flamegraph Empty, and Native Allocations
How to fix memray errors — memray run command not found, flamegraph shows no data, native allocations not tracked, live mode TUI broken, attach to running process fails, and pytest integration.
Fix: attrs Not Working — Slots Conflict, Validator Errors, and dataclasses Migration
How to fix attrs errors — attrs.define vs attr.s API confusion, __slots__ inheritance issues, validator not running on assignment, converter type narrowing, cattrs structuring failed, and difference from dataclasses.
Fix: Peewee Not Working — Connection Pooling, Field Errors, and Migration Setup
How to fix Peewee errors — OperationalError database is locked, connection already open, field type mismatch, model meta database missing, N+1 queries, and peewee-migrate setup.
Fix: conda Not Working — Solver Hangs, Channel Conflicts, and Environment Activation
How to fix conda errors — solving environment takes hours, channel conflicts conda-forge vs defaults, CondaSSLError, conda activate not working in shell, pip and conda mixing breaking env, and mamba/libmamba solver.
Fix: psycopg Not Working — psycopg2 to psycopg3 Migration, Connection Pool, and Async Errors
How to fix psycopg errors — psycopg2 to psycopg 3 import migration, connection pool setup, row factory tuple vs dict, COPY protocol changes, async psycopg pool, server-side cursor confusion, and binary mode performance.
Fix: asyncpg Not Working — Connection Pool, Prepared Statements, and Transaction Errors
How to fix asyncpg errors — connection refused localhost 5432, pool exhausted timeout, prepared statement does not exist, type codec not registered, JSON automatic conversion, and transaction rollback on exception.
Fix: PDM Not Working — Lock File Errors, PEP 582 Confusion, and Script Issues
How to fix PDM errors — pdm install fails resolving dependencies, lock file outdated warning, __pypackages__ vs venv confusion, pdm run script not found, build backend missing, and dependency groups setup.
Fix: Hatch Not Working — Environment Errors, Build Backend, and pyproject.toml Issues
How to fix Hatch errors — hatch env create fails, scripts not found, build backend hatchling missing, version not detected, plugin install errors, and publishing to PyPI.
Fix: Milvus Not Working — Connection Errors, Schema Setup, and Index Build Failures
How to fix Milvus errors — pymilvus connection refused localhost 19530, collection schema mismatch, index not built before search, partition not found, embedded vs standalone vs cluster, and flush before search.
Fix: MkDocs Not Working — Material Theme, Navigation, and Plugin Errors
How to fix MkDocs errors — Config value 'theme' must be a string or dict, mkdocstrings not generating API docs, navigation pages missing, mkdocs serve port already in use, GitHub Pages deploy failed, and broken links not detected.
Fix: Weaviate Not Working — Client v4 Migration, Schema Setup, and Vectorizer Errors
How to fix Weaviate errors — client v3 to v4 migration breaking imports, schema creation property mismatch, vectorizer module not loaded, connection refused localhost 8080, batch import errors, and hybrid search alpha tuning.
Fix: Sphinx Not Working — Autodoc Import Errors, Theme Issues, and Cross-References
How to fix Sphinx errors — autodoc cannot import module, theme not found, intersphinx links broken, ReadTheDocs build failed, MyST markdown not rendering, and unknown directive in conf.py.
Fix: DVC Not Working — Remote Push Errors, Pipeline DAG Issues, and Git Integration
How to fix DVC errors — dvc push authentication failed, dvc pull file missing, pipeline stage not reproducing, cache out of disk space, dvc add vs dvc stage, conflict with git LFS, and S3/GCS remote setup.
Fix: Structlog Not Working — Processor Chain, Context Variables, and Stdlib Integration
How to fix Structlog errors — output is dict not JSON, context vars not propagating, stdlib logging not unified, async context loss, configure_once, KeyValueRenderer vs JSONRenderer, and async filtering.
Fix: Tenacity Not Working — Retries Not Firing, Exception Filters, and Async Support
How to fix Tenacity errors — retry decorator not retrying, stop_after_attempt vs stop_after_delay, retry_if_exception_type filter, async retry decorator, jitter for backoff, and RetryError unwrap original exception.
Fix: Click Not Working — Group Setup, Context Passing, and Parameter Type Errors
How to fix Click errors — UsageError missing argument, Group has no command, ctx.obj not passing between commands, ParamType validation failed, BadOptionUsage no such option, pass_context required, and lazy loading groups.
Fix: Rich Not Working — Live Display Issues, Color in CI, and Console Configuration
How to fix Rich errors — colors not appearing in CI logs, Live display flickering, progress bar not updating, table column overflow, traceback install conflicts, and Console redirect issues.
Fix: Typer Not Working — Argument Errors, Autocomplete, and Subcommand Issues
How to fix Typer errors — type annotation required error, Optional argument parsing, boolean flag conventions, autocomplete installation failed, nested commands not found, and rich traceback disable.
Fix: aiohttp Not Working — Session Leaks, ClientTimeout, and Connector Errors
How to fix aiohttp errors — RuntimeError session is closed, ClientConnectorError connection refused, SSL verify failure, Unclosed client session warning, server websocket disconnect, and connector pool exhausted.
Fix: Apache Airflow Not Working — DAG Not Found, Task Failures, and Scheduler Issues
How to fix Apache Airflow errors — DAG not appearing in UI, ImportError preventing DAG load, task stuck in running or queued, scheduler not scheduling, XCom too large, connection not found, and database migration errors.
Fix: BeautifulSoup Not Working — Parser Errors, Encoding Issues, and find_all Returns Empty
How to fix BeautifulSoup errors — bs4.FeatureNotFound install lxml, find_all returns empty list, Unicode decode error, JavaScript-rendered content not found, select vs find_all confusion, and slow parsing on large HTML.
Fix: ChromaDB Not Working — Persistent Client, Collection Errors, and Embedding Function Issues
How to fix ChromaDB errors — persistent client not saving data, collection already exists error, dimension mismatch in embeddings, embedding function required, HTTP client connection refused, and memory growing unbounded.
Fix: CrewAI Not Working — Agent Delegation, Task Context, and LLM Configuration Errors
How to fix CrewAI errors — LLM not configured ValidationError, agent delegation loop, task context not passed between agents, tool output truncated, process hierarchical vs sequential, and memory not persisting across runs.
Fix: Dagster Not Working — Asset Loading, Resource Errors, and Daemon Issues
How to fix Dagster errors — asset not found in definitions, resource not defined, dagster daemon not running, sensor or schedule not firing, DagsterInvariantViolationError, and asset materialization failing.
Fix: Dash Not Working — Callback Errors, Pattern Matching, and State Management
How to fix Dash errors — circular dependency in callbacks, pattern matching callback not firing, missing attribute clientside_callback, DataTable filtering not working, clientside JavaScript errors, Input Output State confusion, and async callback delays.
Fix: Dask Not Working — Scheduler Errors, Out of Memory, and Delayed Not Computing
How to fix Dask errors — KilledWorker out of memory, client cannot connect to scheduler, delayed not computing, DataFrame partition size wrong, map_partitions TypeError, diagnostics dashboard not showing, and version mismatch.
Fix: dbt Not Working — ref() Not Found, Schema Mismatch, and Compilation Errors
How to fix dbt errors — ref() model not found, profile not found, database relation does not exist, incremental model schema mismatch requiring full-refresh, dbt deps failure, Jinja compilation errors, and test failures.
Fix: FAISS Not Working — Import Errors, Index Selection, and GPU Setup
How to fix FAISS errors — ImportError cannot import name swigfaiss, faiss-gpu vs faiss-cpu install, IndexFlatL2 slow on large data, IVF training required, index serialization write_index, and dimension mismatch.
Fix: Gradio Not Working — Share Link, Queue Timeout, and Component Errors
How to fix Gradio errors — share link not working, queue timeout, component not updating, Blocks layout mistakes, flagging permission denied, file upload size limit, and HuggingFace Spaces deployment failures.
Fix: Jupyter Notebook Not Working — Kernel Dead, Module Not Found, and Widget Errors
How to fix Jupyter errors — kernel fails to start or dies, ModuleNotFoundError despite pip install, matplotlib plots not showing, ipywidgets not rendering in JupyterLab, port already in use, and jupyter command not found.
Fix: LangGraph Not Working — State Errors, Checkpointer Setup, and Cyclic Graph Failures
How to fix LangGraph errors — state not updating between nodes, checkpointer thread_id required, StateGraph compile error, conditional edges not routing, streaming events missing, recursion limit exceeded, and interrupt handling.
Fix: LightGBM Not Working — Installation Errors, Categorical Features, and Training Issues
How to fix LightGBM errors — ImportError libomp libgomp not found, do not support special JSON characters in feature name, categorical feature index out of range, num_leaves vs max_depth overfitting, early stopping callback changes, and GPU build errors.
Fix: LlamaIndex Not Working — Import Errors, Vector Store Issues, and Query Engine Failures
How to fix LlamaIndex errors — ImportError llama_index.core module not found, ServiceContext deprecated use Settings instead, vector store index not persisting, query engine returns irrelevant results, and LlamaIndex 0.10 migration.
Fix: Locust Not Working — User Class Errors, Distributed Mode, and Throughput Issues
How to fix Locust errors — no locustfile found, User class not detected, worker connection refused, distributed mode throughput lower than single-node, StopUser exception, FastHttpUser vs HttpUser, and headless CSV reports.
Fix: Loguru Not Working — Missing Logs, Rotation Errors, and Multiprocessing Issues
How to fix Loguru errors — logs not appearing after logger.add, file rotation not working, enqueue required for multiprocessing, structured logging JSON, intercepting stdlib logging, and handler removal.
Fix: Matplotlib Not Working — Plots Not Showing, Blank Output, and Figure Layout Problems
How to fix Matplotlib errors — plot not displaying, blank figure, RuntimeError main thread not in main loop, tight_layout UserWarning, overlapping subplots, savefig saving blank image, backend errors, and figure/axes confusion.
Fix: MLflow Not Working — Tracking URI, Artifact Store, and Model Registry Errors
How to fix MLflow errors — no tracking server, artifact path not accessible, model version not found, experiment not found, MLFLOW_TRACKING_URI not set, autolog not recording metrics, and MLflow UI showing no runs.
Fix: ONNX Not Working — Conversion Errors, Runtime Provider Issues, and Dynamic Shape Problems
How to fix ONNX errors — torch.onnx.export unsupported operator, ONNX Runtime CUDA provider not found, InvalidArgument input shape mismatch, dynamic axes not working, IR version mismatch, and opset version conflicts.
Fix: OpenCV Not Working — imread Returns None, imshow Crash, and Color Channel Errors
How to fix OpenCV errors — cv2.imread returns None, imshow crashes on headless server, BGR vs RGB color mismatch, cannot open video capture, ImportError libGL not found, resize interpolation, and cv2.error assertion failed.
Fix: Optuna Not Working — Trial Pruned, Storage Errors, and Search Space Problems
How to fix Optuna errors — TrialPruned stops too early, RDB storage locked or not saving, suggest methods raise ValueError, parallel study workers deadlock, integration callbacks not reporting, and best trial not reproducible.
Fix: pgvector Not Working — Extension Install, Index Not Used, and Dimension Errors
How to fix pgvector errors — extension does not exist CREATE EXTENSION vector, dimension mismatch on insert, HNSW index not used slow queries, distance operator confusion, psycopg register adapter, and ivfflat vs hnsw selection.
Fix: Pillow PIL Not Working — Cannot Identify Image, Mode Errors, and EXIF Rotation
How to fix Pillow PIL errors — UnidentifiedImageError cannot identify image file, OSError cannot write mode RGBA as JPEG, EXIF orientation rotated wrong, decompression bomb warning, ImageDraw text rendering, and HEIF AVIF support missing.
Fix: Pinecone Not Working — Index Creation, Serverless vs Pod, and Python SDK v3 Migration
How to fix Pinecone errors — ApiException 401 unauthorized, index not found, dimension mismatch, serverless spec required, Python SDK v3 breaking changes, namespace confusion, and upsert rate limit 429.
Fix: Plotly Not Working — Figure Not Showing, Kaleido Export Errors, and Subplot Issues
How to fix Plotly errors — figure not rendering in Jupyter, ValueError must install Kaleido, static image export slow or crashing, subplot trace placement, update_layout not working, and offline vs online mode confusion.
Fix: Polars Not Working — AttributeError, InvalidOperationError, and ShapeError
How to fix Polars errors — AttributeError groupby not found, InvalidOperationError from Python lambdas, ShapeError broadcasting mismatch, lazy vs eager collect confusion, type casting failures, and ColumnNotFoundError in with_columns.
Fix: pre-commit Not Working — Hooks Not Running, Install Failures, and CI Issues
How to fix pre-commit errors — hooks not triggering on commit, pre-commit install failed, repo local hook not found, autoupdate not working, CI environment cache issues, and skip specific hooks.
Fix: Prefect Not Working — Flow Deployment, Worker Errors, and 2.x to 3.x Migration
How to fix Prefect errors — flow deployment not running, worker not picking up runs, PrefectHTTPStatusError cannot connect to API, task retries not working, state transitions stuck in Pending, and flow_run_name template not resolving.
Fix: PySpark Not Working — Java Heap Space, Serialization Errors, and OOM Exceptions
How to fix PySpark errors — Java heap space out of memory, PicklingError cannot serialize, py4j gateway exception, Spark session not found, partition skew causing slow shuffle, lazy evaluation confusion, and collect crashing driver.
Fix: Qdrant Not Working — Connection Errors, Collection Setup, and Filter Syntax Issues
How to fix Qdrant errors — connection refused to localhost 6333, collection not found create_collection, vector size mismatch, filter must match schema, payload index missing slow queries, and timeout on large batch uploads.
Fix: Ray Not Working — Cluster Init, Object Store Memory, and Actor Lifecycle Errors
How to fix Ray errors — ray.init connection refused, object store full ObjectStoreFullError, worker died unexpectedly, serialization PickleError for remote function, Ray Tune trials fail, Ray cluster version mismatch, and actor ReferenceError.
Fix: Ruff Not Working — Configuration Errors, Rule Selection, and Format vs Lint Confusion
How to fix Ruff errors — pyproject.toml configuration not applied, rule code unknown, ruff format vs ruff check confusion, ignore not working, per-file-ignores, line-length conflicts, and migrating from Flake8 Black isort.
Fix: Scrapy Not Working — Spider Crawl Returns Nothing, Robots.txt Blocked, and Pipeline Errors
How to fix Scrapy errors — spider yields no items, robots.txt blocking all requests, 403 forbidden response, AttributeError on response.css, item pipeline not processing, AsyncIO reactor errors, and middleware not running.
Fix: Seaborn Not Working — FutureWarning, FacetGrid Errors, and Figure-Level Confusion
How to fix Seaborn errors — FutureWarning use of palette without hue, figure-level vs axes-level function confusion, FacetGrid layout issues, tight_layout with seaborn, seaborn 0.13 breaking changes, and ci parameter deprecated.
Fix: Selenium Not Working — WebDriver Errors, Element Not Found, and Timeout Issues
How to fix Selenium errors — WebDriverException session not created, NoSuchElementException element not found, StaleElementReferenceException, TimeoutException waiting for element, headless Chrome crashes, and driver version mismatch.
Fix: scikit-learn Not Working — NotFittedError, NaN Input, Pipeline, and ConvergenceWarning
How to fix scikit-learn errors — NotFittedError call fit before predict, ValueError Input contains NaN, could not convert string to float, Pipeline ColumnTransformer mistakes, cross-validation leakage, n_jobs hanging on Windows, and ConvergenceWarning.
Fix: Streamlit Not Working — Session State, Cache, and Rerun Problems
How to fix Streamlit errors — session state KeyError state not persisting, @st.cache deprecated migrate to cache_data cache_resource, file upload resetting, slow app loading on every interaction, secrets not loading, and widget rerun loops.
Fix: TensorFlow Not Working — OOM, Shape Mismatch, GPU Not Found, and Keras Errors
How to fix TensorFlow errors — GPU not detected CUDA library missing, ResourceExhaustedError OOM, InvalidArgumentError shape mismatch, NaN loss, @tf.function AutoGraph failures, and Keras 3 breaking changes in TF 2.16+.
Fix: vLLM Not Working — CUDA OOM, Model Loading, and API Server Errors
How to fix vLLM errors — CUDA out of memory during model load, tokenizer mismatch with HuggingFace, tensor parallel size does not match GPU count, KV cache exceeds memory, OpenAI API compatibility issues, and max_model_len too large.
Fix: Weights & Biases (wandb) Not Working — Login Errors, Init Hangs, and Sync Failures
How to fix wandb errors — API key not set login failed, wandb init hangs, offline mode sync, artifact upload failure, run not showing in dashboard, image logging size limit, and sweep agent not starting.
Fix: OpenAI Whisper Not Working — FFmpeg Missing, GPU Slow, and Language Detection Errors
How to fix Whisper errors — FFmpeg not found audio file load failed, CUDA out of memory on large model, slow CPU transcription, language detected incorrectly, hallucinations on silence, faster-whisper migration, and timestamp accuracy.
Fix: XGBoost Not Working — Feature Name Mismatch, GPU Errors, and Early Stopping Changes
How to fix XGBoost errors — feature names mismatch, XGBoostError GPU training fails, use_label_encoder deprecated, eval_metric warning, early stopping moved to callback, ValueError for DMatrix, and sklearn API confusion.
Fix: Hugging Face Transformers Not Working — OSError, CUDA OOM, and Generation Errors
How to fix Hugging Face Transformers errors — OSError can't load tokenizer, gated repo access, CUDA out of memory with device_map auto, bitsandbytes not installed, tokenizer padding mismatch, pad_token_id warning, and LoRA adapter loading failures.
Fix: Kafka Consumer Not Receiving Messages, Connection Refused, and Rebalancing Errors
How to fix Apache Kafka issues — consumer not receiving messages, auto.offset.reset, Docker advertised.listeners, max.poll.interval.ms rebalancing, MessageSizeTooLargeException, and KafkaJS errors.
Fix: LangChain Python Not Working — ImportError, Pydantic, and Deprecated Classes
How to fix LangChain Python errors — ImportError from package split, Pydantic v2 compatibility, AgentExecutor deprecated, ConversationBufferMemory removed, LCEL output type mismatches, and tool calling failures.
Fix: OpenAI API Not Working — RateLimitError, 401, 429, and Connection Issues
How to fix OpenAI API errors — RateLimitError (429), AuthenticationError (401), APIConnectionError, context length exceeded, model not found, and SDK v0-to-v1 migration mistakes.
Fix: PyTorch Not Working — CUDA Out of Memory, Device Mismatch, and NaN Loss
How to fix PyTorch errors — CUDA out of memory, expected all tensors on same device, CUDA device-side assert triggered, torch.cuda.is_available() False, inplace gradient errors, DataLoader Windows crash, dtype mismatch, and NaN loss.
Fix: uv Not Working — Command Not Found, Python Version Error, and Lock File Conflicts
How to fix uv errors — uv command not found after install, no Python interpreter found, uv run vs activate confusion, uv.lock merge conflicts, uv pip vs uv add, migrating from pip and Poetry, and workspace resolution failures.
Fix: Python Packaging Not Working — Build Fails, Package Not Found After Install, or PyPI Upload Errors
How to fix Python packaging issues — pyproject.toml setup, build backends (setuptools/hatchling/flit), wheel vs sdist, editable installs, package discovery, and twine upload to PyPI.
Fix: Celery Beat Not Working — Scheduled Tasks Not Running or Beat Not Starting
How to fix Celery Beat issues — beat scheduler not starting, tasks not executing on schedule, timezone configuration, database scheduler, and running beat with workers.
Fix: OpenTelemetry Not Working — Traces Not Appearing, Spans Missing, or Exporter Connection Refused
How to fix OpenTelemetry issues — SDK initialization order, auto-instrumentation setup, OTLP exporter configuration, context propagation, and missing spans in Node.js, Python, and Java.
Fix: Python contextmanager Not Working — GeneratorExit, Missing yield, or Cleanup Not Running
How to fix Python context manager issues — @contextmanager generator, __enter__ and __exit__, exception handling inside with blocks, async context managers, and common pitfalls.
Fix: Python Protocol Not Working — Type Checker Rejects Compatible Class, runtime_checkable Fails, or Protocol Not Recognized
How to fix Python Protocol class issues — structural subtyping vs nominal typing, runtime_checkable, Protocol inheritance, TypeVar constraints, and common mypy/pyright errors with Protocol.
Fix: Python subprocess Not Working — Output Empty, Command Not Found, or Permission Denied
How to fix Python subprocess issues — capturing stdout/stderr, shell=True risks, Popen vs run, timeout handling, and common subprocess errors explained.
Fix: Python pathlib Not Working — Path Object Errors, Joins, and Common Pitfalls
How to fix Python pathlib issues — TypeError with string concatenation, path joining, glob patterns, reading files, cross-platform paths, and migrating from os.path.
Fix: Python Decorator Not Working — Function Signature Lost or Decorator Not Applied
How to fix Python decorator issues — functools.wraps, decorator factories with arguments, class decorators, stacking order, async function decorators, and common pitfalls.
Fix: Python mypy Type Error — Incompatible Types and Missing Annotations
How to fix Python mypy type errors — incompatible types in assignment, missing return type, Optional handling, TypedDict, Protocol, overloads, and common mypy configuration mistakes.
Fix: Python Circular Import Error — ImportError and Cannot Import Name
How to fix Python circular import errors — restructuring modules, lazy imports, TYPE_CHECKING guard, dependency injection, and __init__.py import order issues.
Fix: Celery Task Not Executing — Worker Not Processing Tasks
How to fix Celery tasks not executing — worker configuration, broker connection issues, task routing, serialization errors, and debugging stuck or lost tasks.
Fix: Python logging Not Showing Output
How to fix Python logging not displaying messages — log level misconfiguration, missing handlers, root logger vs named loggers, basicConfig not working, and logging in libraries vs applications.
Fix: Python venv Using Wrong Python Version
How to fix Python virtual environments using the wrong Python version — venv picking system Python instead of pyenv, specifying the interpreter path, and verifying the active environment.
Fix: Python dataclass Mutable Default Value Error (ValueError / TypeError)
How to fix Python dataclass mutable default errors — why lists, dicts, and sets cannot be default field values, how to use field(default_factory=...), and common dataclass pitfalls with inheritance and ClassVar.
Fix: Python requests.get() Hanging — Timeout Not Working
How to fix Python requests hanging forever — why requests.get() ignores timeout, how to set connect and read timeouts correctly, use session-level timeouts, and handle timeout exceptions properly.
Fix: Python threading Not Running in Parallel (GIL Limitations)
How to fix Python threading not achieving parallelism due to the GIL — when to use multiprocessing, concurrent.futures, or asyncio instead, and what the GIL actually blocks.
Fix: Python multiprocessing Not Working (freeze_support, Pickle Errors, Zombie Processes)
How to fix Python multiprocessing not working — freeze_support error on Windows, pickle errors with lambdas, zombie processes, and Pool hanging indefinitely.
Fix: Python SSL: CERTIFICATE_VERIFY_FAILED
How to fix Python SSL CERTIFICATE_VERIFY_FAILED error caused by missing root certificates on macOS, expired system certs, corporate proxies, and self-signed certificates in requests, urllib, and httpx.
Fix: Celery Task Not Received or Not Executing
Fix Celery tasks not being received or executed by resolving broker connections, autodiscovery issues, task name mismatches, and worker configuration.
Fix: AWS Lambda Unable to import module / Runtime.ImportModuleError
How to fix the AWS Lambda Runtime.ImportModuleError and Unable to import module error caused by wrong handler paths, missing dependencies, layer issues, and packaging problems.
Fix: Python TypeError: unhashable type: 'list'
Learn why Python raises TypeError unhashable type list, dict, or set and how to fix it when using dictionary keys, sets, groupby, dataclasses, and custom classes.
Fix: Python ValueError: Too Many Values to Unpack
Learn why Python raises ValueError too many values to unpack and how to fix it when unpacking tuples, iterating dictionaries, parsing files, and using zip or enumerate.
Fix: Python RuntimeError: no running event loop / This event loop is already running
How to fix Python asyncio RuntimeError no running event loop and event loop already running caused by mixing sync and async code, Jupyter, and wrong loop management.
Fix: Python AttributeError: 'NoneType' object has no attribute
How to fix Python AttributeError NoneType object has no attribute caused by functions returning None, method chaining, failed lookups, uninitialized variables, and missing return statements.
Fix: Python requests.exceptions.ConnectionError: Max retries exceeded
How to fix Python requests ConnectionError Max retries exceeded caused by wrong URL, DNS failure, server down, SSL errors, connection pool exhaustion, and firewall blocks.
Fix: Python FileNotFoundError: [Errno 2] No such file or directory
How to fix Python FileNotFoundError No such file or directory caused by relative vs absolute paths, wrong working directory, missing files, pathlib usage, and Docker container file access.
Fix: Python IndexError: list index out of range
How to fix Python IndexError list index out of range caused by empty lists, off-by-one errors, wrong loop bounds, deleted elements, and negative indexing mistakes.
Fix: Python json.decoder.JSONDecodeError: Expecting value
How to fix Python JSONDecodeError Expecting value caused by empty responses, HTML error pages, invalid JSON, BOM characters, and API errors.
Fix: Python KeyError: 'key_name'
How to fix Python KeyError caused by missing dictionary keys, JSON parsing issues, environment variables, pandas DataFrame columns, and unsafe key access patterns.
Fix: Python ModuleNotFoundError even after pip install (venv / virtualenv)
How to fix ModuleNotFoundError in Python when packages are installed but not found inside a virtual environment. Covers venv activation, pip path issues, IDE settings, conda conflicts, and more.
Fix: Python PermissionError: [Errno 13] Permission denied
How to fix Python PermissionError Errno 13 Permission denied when reading, writing, or executing files, covering file permissions, ownership, virtual environments, Windows locks, and SELinux.
Fix: Python RuntimeError: dictionary changed size during iteration
How to fix Python RuntimeError dictionary changed size during iteration caused by modifying a dict while looping over it, with solutions using copies, comprehensions, and safe patterns.
Fix: Python SyntaxError: invalid syntax
How to fix Python SyntaxError invalid syntax caused by missing colons, parentheses, wrong operators, Python 2 vs 3 syntax, f-strings, and walrus operator issues.
Fix: Python TypeError: 'NoneType' object is not subscriptable
Learn why Python raises TypeError NoneType object is not subscriptable and how to fix it with practical solutions for functions, dictionaries, lists, APIs, and regex.
Fix: Python TypeError: missing required positional argument
How to fix Python TypeError missing required positional argument caused by missing self, wrong argument count, class instantiation errors, and decorator issues.
Fix: Python TypeError: takes X positional arguments but Y were given
How to fix Python TypeError takes positional arguments but were given caused by missing self, extra arguments, wrong function calls, and class method confusion.
Fix: Python UnicodeDecodeError – 'utf-8' codec can't decode byte
How to fix Python UnicodeDecodeError 'utf-8' codec can't decode byte in position invalid start byte, covering chardet detection, encoding fallback, BOM handling, pandas CSV encoding, and PYTHONIOENCODING.
Fix: Python ValueError: invalid literal for int() with base 10
How to fix Python ValueError invalid literal for int() with base 10 caused by passing float strings, whitespace, empty strings, or non-numeric characters to int().
Fix: Python ZeroDivisionError: division by zero
Resolve Python's ZeroDivisionError by checking divisors, using try/except, handling empty lists, fixing modulo and Decimal edge cases, and managing numpy/pandas division.
Fix: Python RecursionError - maximum recursion depth exceeded
Resolve Python's RecursionError by converting recursion to iteration, increasing the recursion limit, fixing infinite loops, and using tail-call optimization patterns.
Fix: .env File Not Loading – dotenv Variables Are Undefined in Node.js, Python, or Docker
How to fix .env files not being loaded by dotenv, Next.js, Vite, Django, or Docker Compose, including wrong file path, missing dotenv.config(), and variable naming issues.
Fix: Python IndentationError – Unexpected Indent or Expected an Indented Block
How to fix Python IndentationError including unexpected indent, expected an indented block, and unindent does not match, caused by mixed tabs and spaces or incorrect nesting.
Fix: python: command not found (or python3: No such file or directory)
How to fix 'python: command not found', 'python3: command not found', and wrong Python version errors on Linux, macOS, Windows, and Docker. Covers PATH, symlinks, pyenv, update-alternatives, Homebrew, and more.
Fix: SSL certificate problem: unable to get local issuer certificate
How to fix 'SSL certificate problem: unable to get local issuer certificate', 'CERT_HAS_EXPIRED', 'ERR_CERT_AUTHORITY_INVALID', and 'self signed certificate in certificate chain' errors in Git, curl, Node.js, Python, Docker, and more. Covers CA certificates, corporate proxies, Let's Encrypt, certificate chains, and self-signed certs.