question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when using mssql-cli with Python 3.10 latest version

See original GitHub issue

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:

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 <module>
    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 <module>
    from cli_helpers.tabular_output import TabularOutputFormatter
  File "C:\Python310\lib\site-packages\cli_helpers\tabular_output\__init__.py", line 11, in <module>
    from .output_formatter import format_output, TabularOutputFormatter
  File "C:\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:\Python310\lib\site-packages\cli_helpers\tabular_output\tabulate_adapter.py", line 4, in <module>
    from cli_helpers.packages import tabulate
  File "C:\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:\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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:12

github_iconTop GitHub Comments

5reactions
nicholasyincommented, Feb 25, 2022

Are you surprised how they simply ignore this and don’t want to fix it at all?

4reactions
tirkarthicommented, Oct 10, 2021

tabulate was removed as a vendored package and added as a dependency. Perhaps you might want to upgrade cli_helpers package.

https://github.com/dbcli/cli_helpers/commit/a21650dd458d42936aa95ad41b8f676e81579b91

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · dbcli/mssql-cli - GitHub
Error when using mssql-cli with Python 3.10 latest version. #531 opened on Oct 9, 2021 by jmoralesv · 12. Can this be used...
Read more >
Install | DBA From The Cold
The issue with Ubuntu 22.04 is that it has python 3.10 installed by default which the current mssql-cli is not compatible with. I...
Read more >
Unable to upgrade Python 3.8.10 to 3.10 - SOLVED
Python 3.8 is the default version that comes with Ubuntu But the latest version is Python 3.10. In this article, we upgrade to...
Read more >
mssql-cli - PyPI
mssql-cli. mssql-cli is an interactive command line query tool for SQL Server. This open source tool works cross-platform and proud to be a...
Read more >
Installing mssql-cli on Ubuntu 22.04 - Curated SQL
The issue with Ubuntu 22.04 is that it has python 3.10 installed by default which the current mssql-cli is not compatible with.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found