question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

After updating `psycopg2`, installing meltano now requires `pg_config` to be present on system

See original GitHub issue

Migrated from GitLab: https://gitlab.com/meltano/meltano/-/issues/2063

Originally created by @DouweM on 2020-05-26 20:49:52


Technically introduced by https://gitlab.com/meltano/meltano/-/merge_requests/1665

Failure in job that didn’t have pg_config: https://gitlab.com/meltano/meltano/-/jobs/568513947

Error message
    digitalocean:   Downloading psycopg2-2.8.5.tar.gz (380 kB)
==> digitalocean:     ERROR: Command errored out with exit status 1:
==> digitalocean:      command: /var/meltano/.venv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-3k2ro1j7/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-3k2ro1j7/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-nlhb7bn4
==> digitalocean:          cwd: /tmp/pip-install-3k2ro1j7/psycopg2/
==> digitalocean:     Complete output (23 lines):
==> digitalocean:     running egg_info
==> digitalocean:     creating /tmp/pip-pip-egg-info-nlhb7bn4/psycopg2.egg-info
==> digitalocean:     writing /tmp/pip-pip-egg-info-nlhb7bn4/psycopg2.egg-info/PKG-INFO
==> digitalocean:     writing dependency_links to /tmp/pip-pip-egg-info-nlhb7bn4/psycopg2.egg-info/dependency_links.txt
==> digitalocean:     writing top-level names to /tmp/pip-pip-egg-info-nlhb7bn4/psycopg2.egg-info/top_level.txt
==> digitalocean:     writing manifest file '/tmp/pip-pip-egg-info-nlhb7bn4/psycopg2.egg-info/SOURCES.txt'
==> digitalocean:
==> digitalocean:     Error: pg_config executable not found.
==> digitalocean:
==> digitalocean:     pg_config is required to build psycopg2 from source.  Please add the directory
==> digitalocean:     containing pg_config to the $PATH or specify the full executable path with the
==> digitalocean:     option:
==> digitalocean:
==> digitalocean:         python setup.py build_ext --pg-config /path/to/pg_config build ...
==> digitalocean:
==> digitalocean:     or with the pg_config option in 'setup.cfg'.
==> digitalocean:
==> digitalocean:     If you prefer to avoid building psycopg2 from source, please install the PyPI
==> digitalocean:     'psycopg2-binary' package instead.
==> digitalocean:
==> digitalocean:     For further information please check the 'doc/src/install.rst' file (also at
==> digitalocean:     <https://www.psycopg.org/docs/install.html>).
==> digitalocean:
==> digitalocean:     ----------------------------------------
==> digitalocean: ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Our users could run into this as well, which is not ideal because we want to make installing Meltano as easy as possible.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
vischcommented, Aug 12, 2022

@DouweM Hi, we are currently using the image version meltano/meltano:latest-python3.9, and we are stumbling upon the same error message as shown above. How do we resolve this?

@paulorijnberg Here’s my working docker file with the changes I had to add for this, hope it helps!

RUN apt install libpq-dev -y is the difference

# registry.gitlab.com/meltano/meltano:latest is also available in GitLab Registry
ARG MELTANO_IMAGE=meltano/meltano:latest
FROM $MELTANO_IMAGE

WORKDIR /project
RUN apt-get update
RUN apt install libpq-dev -y

# Install any additional requirements
COPY ./requirements.txt .
RUN pip install -r requirements.txt

# Install all plugins into the `.meltano` directory
COPY ./meltano.yml .
RUN meltano install

# Pin `discovery.yml` manifest by copying cached version to project root
RUN cp -n .meltano/cache/discovery.yml . 2>/dev/null || :

# Don't allow changes to containerized project files
ENV MELTANO_PROJECT_READONLY 1

# Copy over remaining project files
COPY . .

# Expose default port used by `meltano ui`
EXPOSE 5000

ENTRYPOINT ["meltano"]
1reaction
paulorijnbergcommented, Aug 12, 2022

@DouweM Hi, we are currently using the image version meltano/meltano:latest-python3.9, and we are stumbling upon the same error message as shown above. How do we resolve this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

After updating `psycopg2`, installing meltano now requires ...
After updating `psycopg2`, installing meltano now requires `pg_config` to be present on system. Technically introduced by !1665 (merged).
Read more >
pg_config executable not found when installing psycopg2 on ...
It appears that during the container build/setup, Docker is trying to find pg_config within the container. Is there a way to install a...
Read more >
psycopg2-binary should not be used. · Issue #186 - GitHub
As discovered in Issue #185, we should not be using the binary package in a production codebase. Currently both versions are required in...
Read more >
tap-postgres - Meltano Hub
Installation and configuration. Add the tap-postgres extractor to your project using meltano add : meltano add extractor tap-postgres
Read more >
meltano - PyPI
Meltano joins data from multiple systems used by Sales, ... After installing meltano CLI, you can choose to run meltano against your project ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found