Open jithin77 opened 1 month ago
Hey @jithin77! 👋 I'm here to help you with any bugs, questions, or contributions you have. Let's squash those bugs together!
To resolve the "poetry not found" error during the Docker build process, ensure that poetry
is correctly installed and added to the PATH
. The Dockerfile should include the following steps:
# Install Poetry
RUN curl -sSL https://install.python-poetry.org | python3 -
# Add Poetry to PATH
ENV PATH="/root/.local/bin:$PATH"
Make sure these lines are placed before any poetry
commands are run. If the issue persists, try rebuilding the Docker image without cache:
docker build --no-cache -t your_image_name .
Additionally, you can use a script to ensure poetry
is properly activated during the build process. Here is an example script:
#!/bin/bash
# Load environment variables from .env file if it exists
if [ -f .env ]; then
echo "Loading environment variables from .env file"
export $(cat .env | sed 's/#.*//g' | xargs)
else
echo ".env file not found, skipping"
fi
# Activate Poetry environment
source $(poetry env info --path)/bin/activate
# Lock dependencies without updating
poetry lock --no-update
# Install dependencies
make install
# Wait for any dependent services
/bin/sh wait-for-it.sh
# Run database migrations
make migrate
# Start the server in the background
make start
This script ensures that poetry
is activated and its environment is used for subsequent commands [1][2].
To continue talking to Dosu, mention @dosu.
having similar issue as well with docker compose build
System Info
pandas AI v2.2.10, Windows 10, Python Python 3.11.9
🐛 Describe the bug
I am trying to build the docker compose which is failing with error "poetry not found". The server docker file have "ENV PATH="/root/.local/bin:$PATH" but not sure why poetry is not recognized.