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

ov is missing dependencies required to run psycopg2 in the container #4515

Open
sarayourfriend opened this issue Jun 19, 2024 · 1 comment
Open
Labels
🤖 aspect: dx Concerns developers' experience with the codebase 🛠 goal: fix Bug fix 🟩 priority: low Low priority and doesn't need to be rushed 🧱 stack: mgmt Related to repo management and automations

Comments

@sarayourfriend
Copy link
Contributor

Description

ov needs this fix: https://docs.openverse.org/general/general_setup.html#psycopg2-build-prerequisites

Reproduction

  1. Run `ov pdm run -p api pgcli` and you will get the following output error:
sara@study ~/projects/openverse main [2] @ ov pdm run -p api pgcli
Traceback (most recent call last):
  File "/opt/pdm/venvs/api-UJMDzYmD-3.11/bin/pgcli", line 5, in <module>
    from pgcli.main import cli
  File "/opt/pdm/venvs/api-UJMDzYmD-3.11/lib/python3.11/site-packages/pgcli/main.py", line 2, in <module>
    from pgspecial.namedqueries import NamedQueries
  File "/opt/pdm/venvs/api-UJMDzYmD-3.11/lib/python3.11/site-packages/pgspecial/__init__.py", line 12, in <module>
    from . import dbcommands
  File "/opt/pdm/venvs/api-UJMDzYmD-3.11/lib/python3.11/site-packages/pgspecial/dbcommands.py", line 7, in <module>
    from psycopg.sql import SQL
  File "/opt/pdm/venvs/api-UJMDzYmD-3.11/lib/python3.11/site-packages/psycopg/__init__.py", line 9, in <module>
    from . import pq  # noqa: F401 import early to stabilize side effects
    ^^^^^^^^^^^^^^^^
  File "/opt/pdm/venvs/api-UJMDzYmD-3.11/lib/python3.11/site-packages/psycopg/pq/__init__.py", line 114, in <module>
    import_from_libpq()
  File "/opt/pdm/venvs/api-UJMDzYmD-3.11/lib/python3.11/site-packages/psycopg/pq/__init__.py", line 106, in import_from_libpq
    raise ImportError(
ImportError: no pq wrapper available.
Attempts made:
- couldn't import psycopg 'c' implementation: No module named 'psycopg_c'
- couldn't import psycopg 'binary' implementation: No module named 'psycopg_binary'
- couldn't import psycopg 'python' implementation: libpq library not found
@sarayourfriend sarayourfriend added 🟩 priority: low Low priority and doesn't need to be rushed 🛠 goal: fix Bug fix 🤖 aspect: dx Concerns developers' experience with the codebase 🧱 stack: mgmt Related to repo management and automations labels Jun 19, 2024
@sarayourfriend
Copy link
Contributor Author

Note: most of the time (maybe all of the time) we run pgcli inside the application containers, and so this isn't an issue, but I think we could still do to solve it inside ov.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 aspect: dx Concerns developers' experience with the codebase 🛠 goal: fix Bug fix 🟩 priority: low Low priority and doesn't need to be rushed 🧱 stack: mgmt Related to repo management and automations
1 participant