dbcli / pgcli

Postgres CLI with autocompletion and syntax highlighting
http://pgcli.com
BSD 3-Clause "New" or "Revised" License
12.04k stars 553 forks source link

Doesn't work with Python 3.11/Windows #1447

Closed manjabes closed 8 months ago

manjabes commented 8 months ago

Description

pgcli doesn't work with Python 3.11 under Windows

$ pgcli
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Program Files\Python311\Scripts\pgcli.exe\__main__.py", line 4, in <module>
  File "C:\Program Files\Python311\Lib\site-packages\pgcli\main.py", line 21, in <module>
    from cli_helpers.tabular_output import TabularOutputFormatter
  File "C:\Program Files\Python311\Lib\site-packages\cli_helpers\tabular_output\__init__.py", line 11, in <module>
    from .output_formatter import format_output, TabularOutputFormatter
  File "C:\Program Files\Python311\Lib\site-packages\cli_helpers\tabular_output\output_formatter.py", line 15, in <module>
    from . import (
  File "C:\Program Files\Python311\Lib\site-packages\cli_helpers\tabular_output\tabulate_adapter.py", line 17, in <module>
    import tabulate
  File "C:\Program Files\Python311\Lib\site-packages\tabulate.py", line 16, in <module>
    from collections import Iterable
ImportError: cannot import name 'Iterable' from 'collections' (C:\Program Files\Python311\Lib\collections\__init__.py)

Your environment

Created a PR in dependency repo https://github.com/dbcli/cli_helpers/pull/86 to attempt to fix this.

ERYoung11 commented 8 months ago

@manjabes Should this issue be closed since your PR was merged?

manjabes commented 8 months ago

The PR was merged, but neither the cli_helpers dependency not pgcli itself hasn't had a release where the updates are included, therefore I'd claim that this issue should remain open.

j-bennet commented 8 months ago

Good point @manjabes . cli_helpers 2.3.1 is now released.

manjabes commented 8 months ago

I got pgcli working for myself now, but had to manually install the newer version of cli_helpers and also prompt-toolkit (because of this ). Perhaps there needs to be a new release for pgcli that pulled the updated versions of these dependencies?

j-bennet commented 8 months ago

If you run pip install -U pgcli, does it get you all the latest dependencies?

manjabes commented 8 months ago

Yes