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

Error on invocation: "No module named mssqlcli"

Open ethan-fox-capsule opened this issue 4 years ago • 3 comments

Hello, I am on macOS Catalina 10.15.7, trying to use mssql-cli to query a SQL Server DB, I installed using pip3 install mssql-cli, but for some reason the CLI thinks it should be pointed at Python 2.7:

❯ pip3 install mssql-cli
< ... >
❯ mssql-cli
/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: No module named mssqlcli

for reference here is the version info of my various relevant commands:

❯ which pip3
/Library/Frameworks/Python.framework/Versions/3.8/bin/pip3
❯ pip3 --version
pip 21.1.3 from /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip (python 3.8)
❯ which python3
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3
❯ python3 --version
Python 3.8.2
❯ which pip
/Library/Frameworks/Python.framework/Versions/3.8/bin/pip
❯ pip --version
pip 21.1.3 from /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip (python 3.8)
❯ which python
/usr/bin/python
❯ python --version
Python 2.7.16

Any pointers for un-crossing the wires to point at the correct directory on cli startup would be appreciated.

ethan-fox-capsule avatar Jun 29 '21 17:06 ethan-fox-capsule

I am having this exact issue as well.

ahearn15 avatar Sep 16 '21 15:09 ahearn15

I also have this issue

Tristacc avatar Oct 11 '21 12:10 Tristacc

Open the mssql-cli with vim(/usr/local/bin/mssql-cli), change the last line which python -m mssqlcli.main "$@" to python3 -m mssqlcli.main "$@", it works for me!

emperorente avatar May 25 '22 14:05 emperorente