1

I've installed pymssql using

pip install pymssql

I verified that it was successfully installed in /usr/local/lib/python3.6/site-packages by running the following commands and each one succeeded.

python3 -i

import pymssql

conn = pymssql.connect(server='mysqlserver', user='myuser', password='mypasswrd', database='mydb')

However when I launch Spyder and type in "import pymssql" in the IPython console, I receive the following error that the module is not found.

ModuleNotFoundError: No module named 'pymssql'

I verified that Spyder is running the Python 3.6 instance installed on my Mac. Any ideas on why my Spyder interpreter is not finding this module? Thank you in advance.

Community
  • 1
  • 1
eTothEipiPlus1
  • 577
  • 2
  • 9
  • 28

2 Answers2

1

first install or upgrade cython:

$ pip install --upgrade cython
$ pip install pymssql

this has worked for me.

Carlos Cordoba
  • 33,273
  • 10
  • 95
  • 124
saomer
  • 11
  • 2
0

Use the instructions on the following link to change the Python interpreter. If you're using Anaconda, by default the Python interpreter is /anaconda3/bin/python. I fixed my problem by changing the interpreter to point to /usr/local/bin/python3.6.

how-to-change-python-version-in-anaconda-spyder

Then you may need to install ipykernel and cloudpickle so that Spyder's IPython console can launch. If so, use the following command in your Terminal.

pip install ipykernel cloudpickle

eTothEipiPlus1
  • 577
  • 2
  • 9
  • 28