0
votes

I'm having trouble importing pypyodbc in a jupyterlab notebook. I'm able to import it in a shell and even "old" jupyter notebooks. I've tried installing it via pip, conda, and manually. When I run !{sys.executable} -m pip install pypyodbc in the notebook it just shows:

Requirement already satisfied: pypyodbc in c:~\appdata\local\continuum\anaconda3\lib\site-packages\pypyodbc-1.3.3-py3.6.egg (1.3.3)

Requirement already satisfied: setuptools in ~\appdata\local\continuum\anaconda3\lib\site-packages (from pypyodbc) (39.1.0)

I can import other packages just fine, but pypyodbc isn't working. What is the default package directory for jupyterlab, and how can I point it to a specific directory to import packages from?

1

1 Answers

0
votes

It's possible you have multiple versions of Python running on your computer and Jupyter is selecting a version that does not have that package. To figure out what version of Python is running in your notebook do this inside Jupyter:

import os
import inspect
inspect.getfile(os)

Then you can run pip on that specific version:

python3.6 -m pip install pypyodbc

Alternatively, you can try to uninstall the package and reinstall via pip if it still doesn't work.