Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] "psycopg2" Dependency fails building Docker Images #110

Closed
2 tasks done
sridharstreaks opened this issue May 30, 2024 · 1 comment
Closed
2 tasks done

[Bug] "psycopg2" Dependency fails building Docker Images #110

sridharstreaks opened this issue May 30, 2024 · 1 comment
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@sridharstreaks
Copy link

Is this a new bug?

  • I believe this is a new bug
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

Hi all,
Building Docker image fails while installing dbt-postgres in integration with cosmos.

  • On this specific step, RUN python -m venv dbt_venv && source dbt_venv/bin/activate && \ pip install --no-cache-dir dbt-postgres && deactivate (adding this in a docker file) and building using astro dev start , I'm receiving the following error
    9.396 Collecting psycopg2<3.0,>=2.9 (from dbt-postgres)
    9.418 Downloading psycopg2-2.9.9.tar.gz (384 kB)
    9.475 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 384.9/384.9 kB 7.4 MB/s eta 0:00:00
    9.542 Installing build dependencies: started
    12.74 Installing build dependencies: finished with status 'done'
    12.74 Getting requirements to build wheel: started
    12.94 Getting requirements to build wheel: finished with status 'error'
    12.95 error: subprocess-exited-with-error
    12.95
    12.95 × Getting requirements to build wheel did not run successfully.
    12.95 │ exit code: 1
    12.95 ╰─> [21 lines of output]
    12.95 running egg_info
    12.95 writing psycopg2.egg-info/PKG-INFO
    12.95 writing dependency_links to psycopg2.egg-info/dependency_links.txt
    12.95 writing top-level names to psycopg2.egg-info/top_level.txt
    12.95
    12.95 Error: pg_config executable not found.
    12.95
    12.95 pg_config is required to build psycopg2 from source. Please add the directory
    12.95 containing pg_config to the $PATH or specify the full executable path with the
    12.95 option:
    12.95
    12.95 python setup.py build_ext --pg-config /path/to/pg_config build ...
    12.95
    12.95 or with the pg_config option in 'setup.cfg'.
    12.95
    12.95 If you prefer to avoid building psycopg2 from source, please install the PyPI
    12.95 'psycopg2-binary' package instead.
    12.95
    12.95 For further information please check the 'doc/src/install.rst' file (also at
    12.95 <https://www.psycopg.org/docs/install.html>).
    12.95
    12.95 [end of output]
    Upon Searching, I guess this is doing something with Postgres and psycopg2 packages. But since that package is used in dbt we're receiving this error. I'm very noob to dbt,airflow,astro and cosmos. So can anyone help me sort this issue out?

Expected Behavior

astro dev start should be building the Airflow along with DBT Adaptor mentinoed in the Docker file.
Refer Here:

Steps To Reproduce

  1. Install Astro CLI
  2. Create a folder and cd into it.
  3. run astro dev init to create an empty airflow project
  4. Add this
    # install dbt into a virtual environment RUN python -m venv dbt_venv && source dbt_venv/bin/activate && \ pip install --no-cache-dir <your-dbt-adapter> && deactivate in the Docker file
  5. Add astronomer-cosmos in the requirements.txt file
  6. run astro dev start to build the Docker Image and Spin up the Airflow container

Relevant log output

No response

Environment

- OS:Windows
- Python:3.10.9
- dbt-postgres:latest

Additional Context

No response

@sridharstreaks sridharstreaks added bug Something isn't working triage labels May 30, 2024
@jtcohen6 jtcohen6 added duplicate This issue or pull request already exists and removed triage labels May 31, 2024
@jtcohen6
Copy link
Contributor

Hey @sridharstreaks - I think this is a duplicate of:

Please see this comment for a full explanation and discussion of the potential paths forward:

@jtcohen6 jtcohen6 closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants