sys.executable results are different in terminal and jupyter notebook

和自甴很熟 提交于 2021-01-29 14:42:52

问题


Because I face a problem: When from imageio import imread in my jupyter notebook, I get the error: ModuleNotFoundError: No module named 'imageio' Whereas I can successfully import in my terminal, I try to figure out what happened. When I execute sys.executable in jupyter notebook and in the terminal, the results are different:

So I tried:(from https://github.com/jupyter/notebook/issues/1524#issuecomment-229713719)

/Users/shinyuwu/anaconda3/bin/python -m pip install ipykernel
/Users/shinyuwu/anaconda3/bin/python -m  ipykernel install

But the sys.executable result in jupyter notebook and terminal are still different. Can anyone help me?


回答1:


I had faced this issue some time back

The way I solved this was

  1. Deleting IPython and Jupyter from the system

  2. rm -rf ~/.local/share/ipython

  3. Reinstall IPython and Jupyter



来源:https://stackoverflow.com/questions/57944841/sys-executable-results-are-different-in-terminal-and-jupyter-notebook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!