Third-party Python libraries in Coze workflows can't be imported, and the problem looks like "I didn't package it", but it's often not that simple. In the public issue, it was mentioned that even if 'requests' was installed in the 'code_server' container, the runtime import failed. The easiest pitfall here is that the environment in which you install the library is not the same as the environment in which the workflow is actually executed.
Coze Studio's official open-source repository is still https://github.com/coze-dev/coze-studio. The overall idea of the official README is that it treats workflows, plugins, knowledge bases, and code execution as a complete link, rather than a separate "native Python environment".
Why "I've already installed it" still doesn't work
Because workflow nodes usually run in an isolated environment, they may not necessarily directly reuse the layer you manually put into the container and pack it. Just because you install it in the shell doesn't mean that the execution node, image layer, or runtime image also has this package. Especially in on-premises deployment scenarios, containers, images, and code execution services are separate, and the illusion of "I clearly installed it, but the system still says no" is most likely to occur.
Common treatment ideas in the community
- First, confirm whether it can be solved with the built-in library, and don't rely on third-party packages.
- If you must use a third-party library, confirm which running image it is installed in, not the current shell.
- Try to put complex logic into external services and let Coze coordinate interfaces instead of cramming all the logic into Python nodes.
A very practical way to judge
If the same piece of code can run natively or manually in the container, but not in the workflow node, the problem is not Python itself, but the execution context. At this time, checking the workflow runtime, image layer, and dependency whitelist is usually more effective than repeatedly 'pip install'.
The feedback on these issues in public issues is very consistent: don't just focus on the installation action, but check which environment the code is running in. If you understand the execution environment, many "package guide failures" will actually directly become "wrong installation location".
One sentence conclusion
The Python package in the Coze workflow doesn't work, usually not because you didn't install it, but because you installed the wrong environment. Confirm the execution container first, and then talk about dependency installation, which will be much more efficient.