uroybd / python3-psycopg2-alpine

A python3 alpine image with psycopg2 support for docker
5 stars 1 forks source link

Error: pg_config executable not found. #2

Open ahopkins opened 6 years ago

ahopkins commented 6 years ago

Using your image, I still was not able to install psycopg2.

Collecting psycopg2==2.7.3.2 (from -r requirements.txt (line 30))
  Downloading psycopg2-2.7.3.2.tar.gz (425kB)
    Complete output from command python setup.py egg_info:
    running egg_info
    creating pip-egg-info/psycopg2.egg-info
    writing pip-egg-info/psycopg2.egg-info/PKG-INFO
    writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
    writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
    writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
    warning: manifest_maker: standard file '-c' not found

    Error: pg_config executable not found.

    Please add the directory containing pg_config to the PATH
    or specify the full executable path with the option:

        python setup.py build_ext --pg-config /path/to/pg_config build ...

    or with the pg_config option in 'setup.cfg'.

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-qq370jos/psycopg2/

Requirements.txt

psycopg2==2.7.3.2

Dockerfile

FROM uroybd/python3-psycopg2-alpine:3.6
ENV PYTHONUNBUFFERED 1
COPY ./ /usr/src/app
WORKDIR /usr/src/app
RUN pip install -r requirements.txt
CMD ["python3", "server.py"]
ahopkins commented 6 years ago

I was able to solve with:

RUN apk update \
    && apk add libpq postgresql-dev \
    && apk add build-base
uroybd commented 6 years ago

Well psycopg2 is preinstalled. That's all the image about.

On Mon, Jan 22, 2018, 2:58 AM Adam Hopkins notifications@github.com wrote:

I was able to solve with:

RUN apk update \ && apk add libpq postgresql-dev \ && apk add build-base

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/uroybd/python3-psycopg2-alpine/issues/2#issuecomment-359280330, or mute the thread https://github.com/notifications/unsubscribe-auth/AEAyftvwsooL59xECjBOOIrhifVrJwLiks5tM6TugaJpZM4Rl820 .

-- উৎসব রায় (Utsob Roy) http://utsob.me