Sql-server – When I run mssql-cli, I get “No module named mssqlcli”

linuxpythonsql serverUbuntu

I just installed mssql-cli with pip,

pip3 install mssql-cli

Then I try to run mssql-cli and I get

$ mssql-cli
/usr/bin/python: No module named mssqlcli

Best Answer

I tried to fix this by submitting a patch #234 (approved but not yet committed). 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 "$@"