I\'m trying to run the anaconda distribution of python libraries in a Jupyter Notebook, but when I run the notebook I keep getting ImportErrors because the python path is set to
For me, I installed Jupyter after creating an environment, but then was trying to run a module installed from the base env. I found by "jupyter kernelspec list" (https://github.com/jupyter/notebook/issues/2563), my kernel.json at C:\Users\username\Anaconda37\share\jupyter\kernels\python3\kernel.json was pointing to the python.exe in my working env. Changed the path and solved it.
This was an exhaustive description of python path setting.
I had this problem when I used Anaconda Navigator and the command line. I typed 'source activate ' into the console and then used Anaconda Navigator to open Jupyter. In Anaconda Navigator, however, I wasn't in the right environment which caused the problem. This is because Anaconda Navigator comes with its own activation for virtual environments (when you click on them). So you either need to activate the virtual environment from the console and then start Jupyter from the console or you need to activate the virtual environment in Anaconda Navigator and start Jupyter from the Navigator. Both ways work but not in combination. :-)
I figured out the solution, since the kernel was set to use the default mac os x's python I fixed it by using the commands
python2 -m pip install ipykernel
python2 -m ipykernel install --user