mssql-cli icon indicating copy to clipboard operation
mssql-cli copied to clipboard

mssql-cli not found

Open mauro-miatello opened this issue 3 years ago • 3 comments

I've tried to install mssql-cli on ubuntu 20.04 using php or apt, both don't work the first method says "/usr/local/bin/mssql-cli: line 16: python: command not found" the second one don't find mssql-cli package to install

mauro-miatello avatar Apr 04 '22 09:04 mauro-miatello

Running into the same issue!

arron-taylor avatar Aug 25 '22 14:08 arron-taylor

You'll have to edit the file ~/.local/bin/mssql-cli and replace python -m mssqlcli.main "$@" With this line ( command -v python3 && python3 -m mssqlcli.main "$@" ) || python -m mssqlcli.main "$@"

@mauro-miatello @arron-taylor

SalemNabeelSalem avatar Sep 26 '22 11:09 SalemNabeelSalem

@SalemNabeelSalem when I edit that line, I still get an error but just later:

File "/usr/local/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.10/site-packages/mssqlcli/main.py", line 122, in <module>
    main()
  File "/usr/local/lib/python3.10/site-packages/mssqlcli/main.py", line 115, in main
    run_cli_with(mssqlcli_options)
  File "/usr/local/lib/python3.10/site-packages/mssqlcli/main.py", line 44, in run_cli_with
    from mssqlcli.mssql_cli import MssqlCli
  File "/usr/local/lib/python3.10/site-packages/mssqlcli/mssql_cli.py", line 14, in <module>
    from cli_helpers.tabular_output import TabularOutputFormatter
  File "/usr/local/lib/python3.10/site-packages/cli_helpers/tabular_output/__init__.py", line 11, in <module>
    from .output_formatter import format_output, TabularOutputFormatter
  File "/usr/local/lib/python3.10/site-packages/cli_helpers/tabular_output/output_formatter.py", line 10, in <module>
    from . import (delimited_output_adapter, vertical_table_adapter,
  File "/usr/local/lib/python3.10/site-packages/cli_helpers/tabular_output/tabulate_adapter.py", line 4, in <module>
    from cli_helpers.packages import tabulate
  File "/usr/local/lib/python3.10/site-packages/cli_helpers/packages/tabulate.py", line 6, in <module>
    from collections import namedtuple, Iterable
ImportError: cannot import name 'Iterable' from 'collections' (/usr/local/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py)
/usr/local/bin/mssql-cli: line 16: python: command not found
/usr/local/bin/mssql-cli: line 17: mssqlcli.main: command not found

zidad avatar Jan 09 '23 10:01 zidad

Hi all -- as mentioned in another thread, a workaround for this issue is installing Python 3.9.7 or 3.9.9. I was able to get this working in a virtualenv after encountering the same error mentioned here.

chrisbrowning avatar Jan 27 '23 14:01 chrisbrowning