naskio / n8n-nodes-python Goto Github PK
View Code? Open in Web Editor NEWRun Python code on n8n
Home Page: https://www.npmjs.com/package/n8n-nodes-python
License: Other
Run Python code on n8n
Home Page: https://www.npmjs.com/package/n8n-nodes-python
License: Other
Hi, I'm getting the following error when importing workflow.json and the build is failing:
An error occurred while importing workflows. See log messages for details.
Cannot update entity because entity id is not set in the entity.
This only occurs with the more recent packages, I have reverted to using 0.210.2-debian and the build works.
Is this possible to access binary data? Do you have examples? Like item.binary
in JavaScript.
Hello, I have an error message Error fetching feature flags ReferenceError: AbortSignal is not defined
when using PythonFunction. The process freezes for 10 seconds, and the result of the test script is displayed correctly, but this error occurs in the log.
Can it come from my nginx proxy manager reverse proxy?
Error 1:
Error fetching feature flags ReferenceError: AbortSignal is not defined
at PostHog.<anonymous> (/usr/lib/node_modules/n8n/node_modules/posthog-core/src/index.ts:460:6)
at step (/usr/lib/node_modules/n8n/node_modules/node_modules/tslib/tslib.es6.js:102:23)
at Object.next (/usr/lib/node_modules/n8n/node_modules/node_modules/tslib/tslib.es6.js:83:53)
at /usr/lib/node_modules/n8n/node_modules/node_modules/tslib/tslib.es6.js:76:71
at new Promise (<anonymous>)
at __awaiter (/usr/lib/node_modules/n8n/node_modules/node_modules/tslib/tslib.es6.js:72:12)
at PostHogCoreStateless.fetchWithRetry (/usr/lib/node_modules/n8n/node_modules/posthog-node/lib/index.cjs.js:1063:16)
at PostHog.<anonymous> (/usr/lib/node_modules/n8n/node_modules/posthog-core/src/index.ts:219:17)
at step (/usr/lib/node_modules/n8n/node_modules/node_modules/tslib/tslib.es6.js:102:23)
at Object.next (/usr/lib/node_modules/n8n/node_modules/node_modules/tslib/tslib.es6.js:83:53)
at /usr/lib/node_modules/n8n/node_modules/node_modules/tslib/tslib.es6.js:76:71
at new Promise (<anonymous>)
at __awaiter (/usr/lib/node_modules/n8n/node_modules/node_modules/tslib/tslib.es6.js:72:12)
at PostHogCoreStateless.getDecide (/usr/lib/node_modules/n8n/node_modules/posthog-node/lib/index.cjs.js:833:16)
at PostHog.<anonymous> (/usr/lib/node_modules/n8n/node_modules/posthog-core/src/index.ts:318:39)
at step (/usr/lib/node_modules/n8n/node_modules/node_modules/tslib/tslib.es6.js:102:23)
at Object.next (/usr/lib/node_modules/n8n/node_modules/node_modules/tslib/tslib.es6.js:83:53)
at /usr/lib/node_modules/n8n/node_modules/node_modules/tslib/tslib.es6.js:76:71
at new Promise (<anonymous>)
at __awaiter (/usr/lib/node_modules/n8n/node_modules/node_modules/tslib/tslib.es6.js:72:12)
at PostHogCoreStateless.getFeatureFlagsAndPayloadsStateless (/usr/lib/node_modules/n8n/node_modules/posthog-node/lib/index.cjs.js:950:16)
at PostHog.<anonymous> (/usr/lib/node_modules/n8n/node_modules/posthog-core/src/index.ts:306:24)
at step (/usr/lib/node_modules/n8n/node_modules/node_modules/tslib/tslib.es6.js:102:23)
at Object.next (/usr/lib/node_modules/n8n/node_modules/node_modules/tslib/tslib.es6.js:83:53)
at /usr/lib/node_modules/n8n/node_modules/node_modules/tslib/tslib.es6.js:76:71
at new Promise (<anonymous>)
at __awaiter (/usr/lib/node_modules/n8n/node_modules/node_modules/tslib/tslib.es6.js:72:12)
at PostHog.call [as getFeatureFlagsStateless] (/usr/lib/node_modules/n8n/node_modules/posthog-node/lib/index.cjs.js:937:16)
at PostHog.capture (/usr/lib/node_modules/n8n/node_modules/posthog-node/src/posthog-node.ts:106:38)
at PostHogClient.track (/usr/lib/node_modules/n8n/src/posthog/index.ts:39:17)
at /usr/lib/node_modules/n8n/src/telemetry/index.ts:193:20
at new Promise (<anonymous>)
at Telemetry.track (/usr/lib/node_modules/n8n/src/telemetry/index.ts:177:10)
at InternalHooks.onWorkflowPostExecute (/usr/lib/node_modules/n8n/src/InternalHooks.ts:371:22)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
Error 2:
Could not initialize license manager sdk
Test python script:
new_items = []
for item in items:
item['newField'] = 'newValue'
new_items.append(item)
return new_items # should return a list
I use this docker-compose file with portainer:
version: '3.8'
services:
n8n:
image: naskio/n8n-python:latest-debian # use this if intended to use heavy python packages
# image: naskio/n8n-python # alpine for light python packages
# command: /bin/sh -c "n8n start"
restart: always
container_name: n8n
environment:
- GENERIC_TIMEZONE=Europe/Moscow
- TZ=Europe/Moscow
- N8N_HOST=n8n.[HIDE DOMAIN]
- N8N_PROTOCOL=https
- N8N_PORT=443
- VUE_APP_URL_BASE_API=https://n8n.[HIDE DOMAIN]/
- WEBHOOK_TUNNEL_URL=https://n8n.[HIDE DOMAIN]/
- N8N_EDITOR_BASE_URL=https://n8n.[HIDE DOMAIN]/
- DB_TYPE=mariadb
- DB_MYSQLDB_HOST=mariadb
- DB_MYSQLDB_PORT=3306
- DB_MYSQLDB_DATABASE=n8n
- DB_MYSQLDB_USER=n8n
- DB_MYSQLDB_PASSWORD=[HIDE PASSWORD]
ports:
- "127.0.0.1:5678:443"
volumes:
- /home/n8n_data:/home/node/
- /home/n8n_data/local-files:/data # by default workdir == /data
- /home/n8n_data/python_scripts:/data/py_scripts
- /home/n8n_data/requirements.txt:/data/requirements
volumes:
n8n_data:
networks:
default:
external: true
name: evilcorp
Hi,
the n8n-python:latest-debian
image still uses N8N_VERSION=0.227.0
Can please update it to the latest
Hi!
I'm testing this node but the 'ERROR: exitCode: 0 spawn python3 ENOENT [Line xxx]' cames on every code tested.
For example:
new_items = []
for item in items:
item['newField'] = 'newValue'
new_items.append(item)
return new_items # should return a list
print(items)
# > list
return items
n8n: v0.224.1
n8n-nodes-python: v0.1.4
It seems to be a problem with the path on the node.js code:
https://stackoverflow.com/questions/55033450/spawn-python-enoent-node-js-in-windows
https://stackoverflow.com/questions/58390884/how-to-fix-error-spawn-py-enoent-error-when-running-python-script-from-electr
https://stackoverflow.com/questions/47099422/error-spawn-python-enoent
hi Naskio,
I encountered a troublesome issue in the n8n.
I think it might be a bug in this code
In line 195, the code 0 represent success, but the stderr will be parse.
if (!code) { returnData.items = parseShellOutput(returnData.stderr); } else { returnData.error = new Error(returnData.stderr); }
Hey @naskio Thanks for putting this package together. Do you have examples of how we can receive the items from previous nodes? Cheers
getting the following error: n8n may have run out of memory while executing it
while executing an HTML parsing job.
n8n was assigned 20g ram, so there is no way the execution on this node would run oom.
I wonder if there is a memory limit on the node itself. How can I config this limit?
I have the following a test.py
script in my py_scripts directory, How can I import the test.py
script using the python function node.
Hi,
I install package with community package on n8n via : https://www.npmjs.com/package/n8n-nodes-python
i set up creadential like this : (i don"t know if the right way)
Then if i run python command it won't work :
cant find python path ?
If i run execute
node with python command is working.
n8n is install on windows 10 machine with npm, following this step : https://docs.n8n.io/hosting/installation/npm/
Latest n8n
Latest nodejs
Running on windows 10 and python 3.9 is install and working.
Hi There
After installing naskio/n8n-python:latest via docker-compose following the requirements I did not find the "Python Node"
Am I missing something?
Note:
My n8n is running using Postgres and everything else is working 100% as intended.
I also currently have no "Scripts" in the python scripts folder as I first want to see how everything works.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.