According to Code node documentation | n8n Docs, Python modules should be automatically installed:
n8n downloads the package automatically the first time you use it.
But instead it’s throwing an error:
What is the error message (if any)?
ModuleNotFoundError: No module named ‘pandas’ The module ‘pandas’ is included in the Pyodide distribution, but it is not installed. You can install it by calling: await micropip.install(“pandas”) in Python, or await pyodide.loadPackage(“pandas”) in JavaScript See for more details.
Adding that await micropip.install(“pandas”) does not fix it either.
Stacktrace
Error: ModuleNotFoundError: No module named 'pandas' The module 'pandas' is included in the Pyodide distribution, but it is not installed. You can install it by calling: await micropip.install("pandas") in Python, or await pyodide.loadPackage("pandas") in JavaScript See https://pyodide.org/en/stable/usage/loading-packages.html for more details. at PythonSandbox.getPrettyError (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@aws-sdk+credential-providers@3.808.0_asn1.js@5_1af219c3f47f2a1223ec4ccec249a974/node_modules/n8n-nodes-base/nodes/Code/PythonSandbox.ts:101:11) at PythonSandbox.runCodeInPython (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@aws-sdk+credential-providers@3.808.0_asn1.js@5_1af219c3f47f2a1223ec4ccec249a974/node_modules/n8n-nodes-base/nodes/Code/PythonSandbox.ts:85:15) at runNextTicks (node:internal/process/task_queues:65:5) at processImmediate (node:internal/timers:453:9) at PythonSandbox.runCodeAllItems (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@aws-sdk+credential-providers@3.808.0_asn1.js@5_1af219c3f47f2a1223ec4ccec249a974/node_modules/n8n-nodes-base/nodes/Code/PythonSandbox.ts:46:27) at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@aws-sdk+credential-providers@3.808.0_asn1.js@5_1af219c3f47f2a1223ec4ccec249a974/node_modules/n8n-nodes-base/nodes/Code/Code.node.ts:168:14) at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+sdk-trace-base@1.29_46e522f8a77ed5eccc0991bfcca21502/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1212:9) at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+sdk-trace-base@1.29_46e522f8a77ed5eccc0991bfcca21502/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1582:27 at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+sdk-trace-base@1.29_46e522f8a77ed5eccc0991bfcca21502/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2158:11
Information on your n8n setup
- n8n version: 1.105.4
- Database: SQLite
- n8n EXECUTIONS_PROCESS setting: default
- Running n8n via Docker
- Operating system: Windows 11
