dbcli / mssql-cli

A command-line client for SQL Server with auto-completion and syntax highlighting
BSD 3-Clause "New" or "Revised" License
1.35k stars 192 forks source link

Newly installation on windows 11 raises error when running for the first time #536

Closed nicholasyin closed 2 years ago

nicholasyin commented 2 years ago

Following the instruction here in this repo, I used Python to install mssql-cli on my Windows 11 laptop. However, running it for the first time just gave me a hit:

C:\Users\nico>mssql-cli
Username (press enter for sa):
Password:
Traceback (most recent call last):
  File "C:\Users\nico\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\nico\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\nico\AppData\Local\Programs\Python\Python310\lib\site-packages\mssqlcli\main.py", line 122, in <module>
    main()
  File "C:\Users\nico\AppData\Local\Programs\Python\Python310\lib\site-packages\mssqlcli\main.py", line 115, in main
    run_cli_with(mssqlcli_options)
  File "C:\Users\nico\AppData\Local\Programs\Python\Python310\lib\site-packages\mssqlcli\main.py", line 44, in run_cli_with
    from mssqlcli.mssql_cli import MssqlCli
  File "C:\Users\nico\AppData\Local\Programs\Python\Python310\lib\site-packages\mssqlcli\mssql_cli.py", line 14, in <module>
    from cli_helpers.tabular_output import TabularOutputFormatter
  File "C:\Users\nico\AppData\Local\Programs\Python\Python310\lib\site-packages\cli_helpers\tabular_output\__init__.py", line 11, in <module>
    from .output_formatter import format_output, TabularOutputFormatter
  File "C:\Users\nico\AppData\Local\Programs\Python\Python310\lib\site-packages\cli_helpers\tabular_output\output_formatter.py", line 10, in <module>
    from . import (delimited_output_adapter, vertical_table_adapter,
  File "C:\Users\nico\AppData\Local\Programs\Python\Python310\lib\site-packages\cli_helpers\tabular_output\tabulate_adapter.py", line 4, in <module>
    from cli_helpers.packages import tabulate
  File "C:\Users\nico\AppData\Local\Programs\Python\Python310\lib\site-packages\cli_helpers\packages\tabulate.py", line 6, in <module>
    from collections import namedtuple, Iterable
ImportError: cannot import name 'Iterable' from 'collections' (C:\Users\nico\AppData\Local\Programs\Python\Python310\lib\collections\__init__.py)
spoilerdo commented 2 years ago

I got the same error, but I am on Windows 10

spoilerdo commented 2 years ago

After searching I figured out that the cause of this problem is probably the fact that this package doesn't support the latest python version: 3.10. @nicholasyin Did you use that Python version as well?

nicholasyin commented 2 years ago

Yes, downgrading python can fix this and work fine.