0

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: enter image description here

enter image description here

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?

Shin Yu Wu
  • 1,129
  • 4
  • 14
  • 23

1 Answers1

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

Dharman
  • 30,962
  • 25
  • 85
  • 135
Anant Gupta
  • 1,090
  • 11
  • 11
  • Thanks for your reply! In the end, I install a virtual environment in jupyter notebook and solved the inconsistency problem. – Shin Yu Wu Oct 20 '19 at 23:41
  • Yes creating envs is good. In my case, I had my envs created. Due to some ubuntu issues, I had to uninstall and reinstall python, anaconda and the envs. removing the ipython folder was the only thing that worked for me :) – Anant Gupta Oct 21 '19 at 08:47
  • Thanks. After messing up with a custom `venv` my `sys.executable` got changed from the conda one to the default system one. I was able to recover it by uninstall and re-install. – Shuhao Cao Feb 24 '21 at 19:44