Hi all, I’m using Meltano in Docker. After updatin...
# troubleshooting
s
Hi all, I’m using Meltano in Docker. After updating to the latest base image, when building my Docker image I run into an issue installing the loader target-postgres. How can I fix this. I installed a fresh copy of Meltano on a clean Ubuntu VM as well, ran
meltano init
and when adding the loader to that clean project the same error occurs.
Copy code
#10 16.59 Loader 'target-postgres' could not be installed: failed to install plugin 'target-postgres'.
#10 16.59   error: subprocess-exited-with-error
#10 16.59   
#10 16.59   × python setup.py egg_info did not run successfully.
#10 16.59   │ exit code: 1
#10 16.59   ╰─> [23 lines of output]
#10 16.59       running egg_info
#10 16.59       creating /tmp/pip-pip-egg-info-bjl0_fkj/psycopg2_binary.egg-info
#10 16.59       writing /tmp/pip-pip-egg-info-bjl0_fkj/psycopg2_binary.egg-info/PKG-INFO
#10 16.59       writing dependency_links to /tmp/pip-pip-egg-info-bjl0_fkj/psycopg2_binary.egg-info/dependency_links.txt
#10 16.59       writing top-level names to /tmp/pip-pip-egg-info-bjl0_fkj/psycopg2_binary.egg-info/top_level.txt
#10 16.59       writing manifest file '/tmp/pip-pip-egg-info-bjl0_fkj/psycopg2_binary.egg-info/SOURCES.txt'
#10 16.59       
#10 16.59       Error: pg_config executable not found.
#10 16.59       
#10 16.59       pg_config is required to build psycopg2 from source.  Please add the directory
#10 16.59       containing pg_config to the $PATH or specify the full executable path with the
#10 16.59       option:
#10 16.59       
#10 16.59           python setup.py build_ext --pg-config /path/to/pg_config build ...
#10 16.59       
#10 16.59       or with the pg_config option in 'setup.cfg'.
#10 16.59       
#10 16.59       If you prefer to avoid building psycopg2 from source, please install the PyPI
#10 16.59       'psycopg2-binary' package instead.
#10 16.59       
#10 16.59       For further information please check the 'doc/src/install.rst' file (also at
#10 16.59       <<https://www.psycopg.org/docs/install.html>>).
#10 16.59       
#10 16.59       [end of output]
s
Hi @steven_herweijer. Easy fix: use the python3.8 meltano docker image as base version. Apparently the problem is: the target fixes to the psycopg-binary 2.8.5 version. That's not compatible with Python 3.9+, so it tries to build psycopg2? I'm not clear on the exact behavior. Either way, you can use a compatible Python version (which is what I do), fork the target and bump the psycopg-binary version, or install the dev tools needed to build from source (not tested, depends on OS). Or something else I don't know 😄 Btw. @taylor this now appeared twice and is something we should fix if we're planning on providing a postgres tap/target at Meltano.
c
The target also is not compatible with Python3.10 due to using a deprecated Python API https://github.com/transferwise/pipelinewise-target-postgres/issues/92