Open Rishabh952008 opened 1 month ago
Hey there, @Rishabh952008! 👋 I'm here to help you with any bugs or questions you have regarding the repository. Let's squash those bugs together!
To resolve the "pg_config executable not found" error when building the Docker Compose setup, you need to ensure that the necessary PostgreSQL development packages are installed. This error typically occurs because the system is missing the pg_config
tool, which is required to build PostgreSQL extensions or dependencies.
Here is how you can resolve this issue:
Install PostgreSQL Development Packages: You need to install the PostgreSQL development packages on your system. The package name may vary depending on your operating system.
For Debian-based systems (like Ubuntu), you can use:
sudo apt-get update
sudo apt-get install libpq-dev
For Red Hat-based systems (like CentOS), you can use:
sudo yum install postgresql-devel
Rebuild the Docker Images: After installing the necessary packages, you should rebuild the Docker images to ensure that the changes take effect.
docker-compose build
By installing the PostgreSQL development packages, the pg_config
executable will be available, and the Docker Compose setup should build successfully [1].
To continue talking to Dosu, mention @dosu.
i have installed postgresql on my windows and added to environment variables but than also dealing with same error. I tried giving path to dockerfile of server and client as well but then another error coming
To resolve the pg_config
not found error when building the Docker Compose setup for the "PANDAS-AI" project on your Windows 11 system, you need to ensure that the PostgreSQL development packages are installed within the Docker environment itself, not just on your host system.
Here is how you can modify the Dockerfile to include the installation of the PostgreSQL development packages:
Dockerfile
used for building the server image.For example, if you are using a Debian-based image, you can add the following line to install the necessary packages:
RUN apt-get update && apt-get install -y postgresql-server-dev-all
Here is a sample modification to the Dockerfile:
FROM python:3.9-slim
# Install dependencies
RUN apt-get update && apt-get install -y \
build-essential \
libpq-dev \
postgresql-server-dev-all
# Set the working directory
WORKDIR /app
# Copy the requirements file
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application code
COPY . .
# Command to run the application
CMD ["python", "app.py"]
After making these changes, rebuild your Docker images:
docker-compose build
This should resolve the pg_config
not found error [1].
To continue talking to Dosu, mention @dosu.
System Info
pandasai version: 2.2.10 python version:3.11.5 windows 11 version: 23H2Windows
🐛 Describe the bug
pg_config executable not found error is coming during docker-compose build after forking and cloning repo I created a virtual env and then ran this command and even due to this error I tried installing pip install psycopg2-binary==2.9.6 and even tried updating in pyproject.toml then also facing same error