After importing a third-party library into the Python sandbox container, the execution results are inconsistent between the container and the web interface #3399

Closed
opened 2026-02-21 17:57:20 -05:00 by yindo · 0 comments
Owner

Originally created by @115341chenzehao on GitHub (May 16, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.8

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

1.I successfully imported the third-party Python library 'mysql-connector-python' into the sandbox container, and the execution of 'import mysql.connector' was successful.
4

2.However, when executing the script in the web interface, the prompt states 'in ModuleNotFoundError: No module named 'mysql' error'
5

'dify-api' and 'sandbox' are network-connected, and the corresponding .py files will be generated within the sandbox container.
6

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @115341chenzehao on GitHub (May 16, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.8 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1.I successfully imported the third-party Python library 'mysql-connector-python' into the sandbox container, and the execution of 'import mysql.connector' was successful. ![4](https://github.com/langgenius/dify/assets/61967670/74b7d10b-69f8-49f3-9b82-c0556a31479d) 2.However, when executing the script in the web interface, the prompt states 'in ModuleNotFoundError: No module named 'mysql' error' ![5](https://github.com/langgenius/dify/assets/61967670/870c7992-47de-452a-859d-ba5d413c55c5) 'dify-api' and 'sandbox' are network-connected, and the corresponding .py files will be generated within the sandbox container. ![6](https://github.com/langgenius/dify/assets/61967670/099f98c5-5963-486d-a4ef-8bc52df8faa0) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 17:57:20 -05:00
yindo closed this issue 2026-02-21 17:57:20 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#3399