The Code node in Dify does not support pip install inside the node runtime.
If you need additional dependencies (e.g., requests, pandas), please add them to the Docker image (for example, in the Dockerfile) before rebuilding and redeploying Dify.
This ensures the packages are available whenever the Code node runs.
1 Like
Complex logic is better handled by starting your own Python HTTP service.
Hi, Dify Sandbox has a feature that installs dependencies at startup when /dependencies/python-requirements.txt is present. With a default Docker-based Dify installation, we only need to create ./volumes/sandbox/dependencies/python-requirements.txt to install additional dependencies in the Dify Sandbox.
This is a handy method, but is there a strong reason why this FAQ recommends adding packages directly to the Docker image instead?
1 Like