dbcli / dbcli/mssql-cli

Error when using mssql-cli with Python 3.10 latest version

Offen
#531 19 Kommentare 10 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
1.4k
Forks
191
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hi all,
I'm writing this issue because I came across an error when using mssql-cli with the latest Pyton 3.10. Installation goes fine, however, when trying to run mssql-cli to connect to a local SQL Server instance, I got this:

```python
PS C:\Users\Jorge> mssql-cli -S . -E
Traceback (most recent call last):
File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Python310\lib\site-packages\mssqlcli\main.py", line 122, in
main()
File "C:\Python310\lib\site-packages\mssqlcli\main.py", line 115, in main
run_cli_with(mssqlcli_options)
File "C:\Python310\lib\site-packages\mssqlcli\main.py", line 44, in run_cli_with
from mssqlcli.mssql_cli import MssqlCli
File "C:\Python310\lib\site-packages\mssqlcli\mssql_cli.py", line 14, in
from cli_helpers.tabular_output import TabularOutputFormatter
File "C:\Python310\lib\site-packages\cli_helpers\tabular_output\__init__.py", line 11, in
from .output_formatter import format_output, TabularOutputFormatter
File "C:\Python310\lib\site-packages\cli_helpers\tabular_output\output_formatter.py", line 10, in
from . import (delimited_output_adapter, vertical_table_adapter,
File "C:\Python310\lib\site-packages\cli_helpers\tabular_output\tabulate_adapter.py", line 4, in
from cli_helpers.packages import tabulate
File "C:\Python310\lib\site-packages\cli_helpers\packages\tabulate.py", line 6, in
from collections import namedtuple, Iterable
ImportError: cannot import name 'Iterable' from 'collections' (C:\Python310\lib\collections\__init__.py)
```

From what I understood, it looks like mssql-cli has a dependency on cli-helpers which in turn depends on some tabular packages and the one for tabulate.py can't find the Iterable type in "collections". Could this mean that the dependencies need to be updated?

I'm not a Python developer, my background is .NET, so I'm not sure how to solve this. For now I'm planning on going back to Python 3.9 which I think it could work, I just wanted to point this out.

Thanks for your help on this.

Regards,
Jorge

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne damit, `mssql-cli -S . -E` mit Python 3.10 zu reproduzieren, und verfolge den Traceback-Pfad durch `mssqlcli/main.py`, `mssqlcli/mssql_cli.py` und `cli_helpers/packages/tabulate.py`. Überprüfe die Kompatibilität der Abhängigkeiten rund um den Import von `Iterable`; abgeschlossen ist die Aufgabe, wenn mssql-cli unter Python 3.10 ohne diesen ImportError startet und die angegebene lokale SQL Server-Instanz erreichen kann.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
cli, databases
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.