Hi all, I'm running into some package dependency i...
# troubleshooting
m
Hi all, I'm running into some package dependency issues with my local meltano installation. I had installed meltano with pipx using the following command
pipx install meltano
which was working fine, but recently I've been getting the below error when trying to run most of meltano's command, such as
meltano install
or
meltano config <tap>
.
Copy code
No module named 'psycopg2'
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /Users/michael.bi/.local/pipx/venvs/meltano/lib/python3.9/site-packages/meltano/cli/_init_.py: │
│ 105 in _run_cli                                                                                  │
│                                                                                                  │
│   102 │   """                                                                                    │
│   103 │   try:                                                                                   │
│   104 │   │   try:                                                                               │
│ ❱ 105 │   │   │   cli(obj={"project": None})                                                     │
│   106 │   │   except ProjectReadonly as err:                                                     │
│   107 │   │   │   raise CliError(                                                                │
│   108 │   │   │   │   f"The requested action could not be completed: {err}",  # noqa: EM102      │
│                                                                                                  │
│ /Users/michael.bi/.local/pipx/venvs/meltano/lib/python3.9/site-packages/click/core.py:1161 in    │
│ _call_                                                                                         │
│                                                                                                  │
│   1158 │                                                                                         │
│   1159 │   def _call_(self, *args: t.Any, **kwargs: t.Any) -> t.Any:                           │
│   1160 │   │   """Alias for :meth:main."""                                                     │
│ ❱ 1161 │   │   return self.main(*args, **kwargs)                                                 │
│   1162                                                                                           │
│   1163                                                                                           │
│   1164 class Command(BaseCommand):                                                               │
│                                                                                                  │
│                                     ... 13 frames hidden ...                                     │
│                                                                                                  │
│ /Users/michael.bi/.local/pipx/venvs/meltano/lib/python3.9/site-packages/sqlalchemy/engine/create │
│ .py:617 in create_engine                                                                         │
│                                                                                                  │
│   614 │   │   for k in util.get_func_kwargs(dbapi_meth):                                         │
│   615 │   │   │   if k in kwargs:                                                                │
│   616 │   │   │   │   dbapi_args[k] = pop_kwarg(k)                                               │
│ ❱ 617 │   │   dbapi = dbapi_meth(**dbapi_args)                                                   │
│   618 │                                                                                          │
│   619 │   dialect_args["dbapi"] = dbapi                                                          │
│   620                                                                                            │
│                                                                                                  │
│ /Users/michael.bi/.local/pipx/venvs/meltano/lib/python3.9/site-packages/sqlalchemy/dialects/post │
│ gresql/psycopg2.py:696 in import_dbapi                                                           │
│                                                                                                  │
│   693 │                                                                                          │
│   694 │   @classmethod                                                                           │
│   695 │   def import_dbapi(cls):                                                                 │
│ ❱ 696 │   │   import psycopg2                                                                    │
│   697 │   │                                                                                      │
│   698 │   │   return psycopg2                                                                    │
│   699                                                                                            │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ModuleNotFoundError: No module named 'psycopg2'
I do have psycopg2 installed on my machine, and things were working before, so not sure what changed. I've tried reinstalling with
pipx
and
uv
as mentioned as this user did without success. It's been difficult to debug further. Any assistance would be very much appreciated. Here are my versions, for reference: 1. MacOS - 15.4.1 2. Meltano - 3.9.1 3. Python - 3.13.5 4. Pyscopg2-binary 2.9.11
1
e
If you see
meltano
in the output of both
pipx list
and
uv tool list
, you need to decide to keep one or the other to avoid further headaches, I suggest you
pipx uninstall meltano
. Then do
uv tool install --with psycogp2-binary meltano
. I would also recommend instead doing
uv tool install 'meltano[postgres]'
. changing your system DB URI to
postgresql+psycopg://...
.
m
That worked--thank you for your help!
np 1