Closed lepangdan closed 3 months ago
Hello, @lepangdan! I'm here to help you with bug reports, answer your questions, and guide you on becoming a contributor. Let's get your issue sorted while we wait for a human maintainer.
To resolve the Runtime Error related to the Poetry configuration when running poetry shell
in the dify/api
directory, follow these steps:
Start the Docker Compose Stack: Ensure that the necessary middleware (PostgreSQL, Redis, and Weaviate) is running.
cd ../docker
docker compose -f docker-compose.middleware.yaml -p dify up -d
cd ../api
Copy and Configure Environment Variables:
Copy .env.example
to .env
and generate a SECRET_KEY
.
cp .env.example .env
sed -i "/^SECRET_KEY=/c\SECRET_KEY=$(openssl rand -base64 42)" .env # For Linux
secret_key=$(openssl rand -base64 42)
sed -i '' "/^SECRET_KEY=/c\\
SECRET_KEY=${secret_key}" .env # For Mac
Create and Activate the Environment: Use Poetry to manage dependencies and activate the environment.
poetry env use 3.10
poetry install
Install Dependencies:
If dependencies are missing from pyproject.toml
, install them from requirements.txt
and requirements-dev.txt
.
poetry shell
poetry add $(cat requirements.txt)
poetry add $(cat requirements-dev.txt) --group dev
Run Database Migrations: Migrate the database to the latest version.
poetry run python -m flask db upgrade
Start the Backend: Run the backend service.
poetry run python -m flask run --host 0.0.0.0 --port=5001 --debug
Check Poetry Configuration:
Ensure your poetry.toml
file in the dify/api
directory is correctly configured.
[virtualenvs]
in-project = true
create = true
prefer-active-python = true
By following these steps, you should be able to resolve the Runtime Error related to the Poetry configuration when running poetry shell
in the dify/api
directory [1][2][3][4].
To continue talking to Dosu, mention @dosu.
Please google how to use poetry instead of submitting a bug report.
Please google how to use poetry instead of submitting a bug report.
As a developer of the open-source repository, you have the authority to close an issue directly or to simply overlook it if you see fit. However, rather than suggesting non-informative responses and discouraging users from reporting issues after they have strictly adhered to the instructions in the provided README.
Upgrade poetry from 1.7.x to 1.8.x work for me.
Self Checks
Dify version
0.6.11
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Runtime Error occurs when running
poetry shell
in api/readme.md.✔️ Expected Behavior
The thing is ok.
❌ Actual Behavior
/dify/api$ poetry shell
RuntimeError
The Poetry configuration is invalid:
'description' is a required property
at /usr/lib/python3/dist-packages/poetry/core/factory.py:43 in create_poetry 39│ message = "" 40│ for error in check_result["errors"]: 41│ message += " - {}\n".format(error) 42│ → 43│ raise RuntimeError("The Poetry configuration is invalid:\n" + message) 44│ 45│ # Load package 46│ name = local_config["name"] 47│ version = local_config["version"]