Poetry install fails in devcontainer #6168

Closed
opened 2026-02-21 18:14:21 -05:00 by yindo · 1 comment
Owner

Originally created by @manse-murhana on GitHub (Oct 19, 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).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

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
Originally created by @manse-murhana on GitHub (Oct 19, 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] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### 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 ```
yindo closed this issue 2026-02-21 18:14:21 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Oct 19, 2024):

@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.

@dosubot[bot] commented on GitHub (Oct 19, 2024): <!-- Greeting --> @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. <!-- Answer --> 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. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#6168