I have some imports in my jupyter notebook and among them is tensorflow:
ImportError Traceback (most recent call last)
I had the same problem, and solved it by looking at the output of:
jupyter kernelspec list
which outputs the kernel information:
python2 /Users/Username/Library/Jupyter/kernels/python2
python3 /Users/Username/Library/Jupyter/kernels/python3
Notice that the path points to the Jupyter kernel for the user. To use it within the the Anaconda environment, it needs to point to the conda env you are using, and look something like Anaconda3\envs\Env_Name\share\jupyter\kernels\python3.
So, to remove the Jupyter kernelspec, just use:
jupyter kernelspec remove python3
or jupyter kernelspec remove python2 if you're using python 2
Now, the output of jupyter kernelspec list should point to the correct kernel.
See https://github.com/jupyter/notebook/issues/397 for more information about this.