{"record":{"id":"eff490f688427aa5","repo":"influxdata/influxdb","slug":"python-environment-initialization-failed-0-please-ensure","errorCode":null,"errorMessage":"Python environment initialization failed: {0}\nPlease ensure Python and pip package manager is installed","messagePattern":"Python environment initialization failed: (.+?)\nPlease ensure Python and pip package manager is installed","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"influxdb3/src/commands/serve.rs","lineNumber":176,"sourceCode":"\n    #[error(\"lost admin token recovery service\")]\n    LostAdminTokenRecovery,\n\n    #[error(\"tls requires both a cert and a key file to be passed in to work\")]\n    NoCertOrKeyFile,\n\n    #[error(\"table cache index initialization failed: {0}\")]\n    TableIndexCacheInitialization(\n        #[source] influxdb3_write::table_index_cache::TableIndexCacheError,\n    ),\n\n    #[error(\n        \"environment variable {0} (named by --node-id-from-env / INFLUXDB3_NODE_ID_FROM_ENV) \\\n        must be set to a valid node id\"\n    )]\n    NodeIdEnvVarMissing(String),\n\n    #[error(\n        \"Python environment initialization failed: {0}\\nPlease ensure Python and pip package manager is installed\"\n    )]\n    PythonEnvironmentInitialization(\n        #[source] influxdb3_processing_engine::environment::PluginEnvironmentError,\n    ),\n}\n\npub type Result<T, E = Error> = std::result::Result<T, E>;\n\n// variable name and migration message tuples\nconst DEPRECATED_ENV_VARS: &[(&str, &str)] = &[(\n    \"INFLUXDB3_PARQUET_MEM_CACHE_SIZE_MB\",\n    \"use INFLUXDB3_FILE_CACHE_SIZE instead, with a unit suffix (e.g. 500mb) or a percentage\",\n)];\n\nconst MIN_REPLAY_PRELOAD_CONCURRENCY: usize = 10; // the min number of files that will be held in memory\n\n// Core catalog limits. The shared catalog crate's `CatalogLimits` defaults are","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3/src/commands/serve.rs#L158-L194","documentation":"Wraps a PluginEnvironmentError from influxdb3_processing_engine raised while initializing the Python environment used by the embedded processing engine (Python plugins). The message additionally hints that Python and pip must be installed.","triggerScenarios":"`influxdb3 serve` starts with the processing engine enabled and Python interpreter/plugin-environment setup fails: missing python3 binary, missing pip/venv, or failure creating/activating the plugin virtualenv.","commonSituations":"Hosts without Python installed, minimal containers lacking pip or venv, wrong python version, or a read-only/blocked plugin environment directory.","solutions":["Install Python 3 and pip on the host (e.g. apt install python3 python3-pip python3-venv).","Read the chained PluginEnvironmentError for the exact failing step and fix accordingly.","Ensure the plugin environment directory is writable and not blocked by policy.","Disable the Python processing engine if plugins are not needed."],"exampleFix":"# before (container without python)\nFROM ubuntu\nRUN apt-get install -y influxdb3\n# after\nRUN apt-get install -y python3 python3-pip python3-venv","handlingStrategy":"validation","validationCode":"which python3 >/dev/null && python3 -m pip --version \\\n  || { echo 'Python 3 and pip are required for the processing engine'; exit 1; }","typeGuard":null,"tryCatchPattern":"match serve_result {\n    Err(Error::PythonEnvironmentInitialization(src)) => {\n        eprintln!(\"Python env init failed: {src}; install python3 + pip\");\n    }\n    ...\n}","preventionTips":["Install python3, pip, and venv in every host/container image.","Verify `python3 -m pip --version` in health checks before startup.","Keep the plugin environment directory writable.","Disable the processing engine if Python plugins are unused."],"tags":["python","plugins","dependency","startup"],"backgroundTag":"missing-dependency","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}