langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
48.44k stars 6.92k forks source link

Poetry install fails in devcontainer #9506

Open 22mSqRi opened 2 hours ago

22mSqRi commented 2 hours ago

Self Checks

Dify version

0.10.0-beta3

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

When developing on devcontainer, the python module does not function properly due to a problem with poetry (https://github.com/python-poetry/poetry/issues/9415). It works by replacing the poetry install -C api command in .devcontainer/post_start_command.sh with cd api && poetry install.

✔️ Expected Behavior

$ cd api && poetry shell
Spawning shell within /workspaces/dify/api/.venv

$ flask --version
Python 3.10.15
Flask 3.0.3
Werkzeug 3.0.4

❌ Actual Behavior

$ flask --version
bash: /workspaces/dify/api/.venv/bin/flask: cannot execute: required file not found
dosubot[bot] commented 2 hours ago

@22mSqRi Hello there! I'm here to help you with any bugs, questions, or contribution needs while you wait for a human maintainer. I'm an expert bot and can assist you with technical support.

The issue you're encountering with poetry install in a devcontainer setup is related to the use of the -C option, which can cause problems with the Python interpreter's path. The suggested workaround is to replace the poetry install -C api command with cd api && poetry install in the .devcontainer/post_start_command.sh script. This change ensures that the Poetry command is executed in the correct context, resolving the path issue and allowing commands like flask --version to work properly.

To continue talking to Dosu, mention @dosu.