I know this answer will be (very) late to contribute to the discussion but maybe it will help someone. I found out what worked for me by following Thomas, who commented above. However, with a bit of a caveat, that I was using pyenv to setup and manage python on my local machine.
So when running sys.executable
in a jupyter notebook cell I found out my python path was /usr/local/Cellar/jupyterlab/3.2.8/libexec/bin/python3.9
, while I expected it to be somewhere along the lines of '/Users/<USER_NAME>/.pyenv/versions/3.9.2/bin/python'
.
This error was attributed to me having installed jupyter through command brew install jupyter
instead of pyenv exec pip install jupyter
. I proceeded to uninstall jupyter with brew and then executing the second command, which now got jupyter up and running!
(note that you would first have to have pyenv setup properly).