Skip to content

Instantly share code, notes, and snippets.

@ZhangMenghe
Created February 5, 2019 18:53
Show Gist options
  • Select an option

  • Save ZhangMenghe/8af39ad1546a712557fd8d42efbaba53 to your computer and use it in GitHub Desktop.

Select an option

Save ZhangMenghe/8af39ad1546a712557fd8d42efbaba53 to your computer and use it in GitHub Desktop.
[Environment][Conda]Import on Jupyter notebook failed where command prompt works

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment