Python in terminal finds module, jupyter notebook does not

I have the same problem. I created a virtualenv, activated it, then pip installed 2 libs PyPdf2 and Jp nb, I launched the ipynb from the virtualenv and the results from sys.executable is the global location and not the virtualenv location. My ipynb files are in the directory under data, but even creating a new notebook in the parent directory or virtualenv’s bin directory, the global install is the result of sys.executable, so no packages in site packages are referenced. Appending paths seem to work but when the kernel is restarted you would have to re-append. Seems like you have to tell jp nb via some sort of config file to use the virtualenv vs global, so I think the json path could be correct, maybe launching the jp nb with a command line argument might work, while in a virtualenv instantiation. Also same results as mentioned by OP, the import of PyPDF2 works in the terminal outside Jp nb, inside the terminal of Jp nb, but not in the note book. If I append the virtual env lib/site-package to path or point sys.executable to the virtualenv bin/pyXX, import works, how ever every time the kernel is started you will have to re run those.