Usually that indicates that the notebook is running with a different Python or in a different environment from Python in the command prompt. Check sys.executable to see which Python it's running in, and sys.path to see where it's looking for imports.
Solution:
$ /Users/abc/anaconda/bin/python -m pip install ipykernel $ /Users/abc/anaconda/bin/python -m ipykernel install --user