sys.executable结果在终端和jupyter笔记本中有所不同

编程入门 行业动态 更新时间:2024-10-27 22:32:12
本文介绍了sys.executable结果在终端和jupyter笔记本中有所不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

因为我遇到了一个问题:在Jupyter笔记本中使用from imageio import imread时,出现错误:ModuleNotFoundError: No module named 'imageio' 尽管我可以在终端中成功导入,但是我尝试弄清楚发生了什么. 当我在Jupyter Notebook和终端中执行sys.executable时,结果是不同的:

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:

所以我尝试了:(来自 github/jupyter /notebook/issues/1524#issuecomment-229713719 )

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

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

但是jupyter笔记本和终端中的sys.executable结果仍然不同.谁能帮我吗?

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

推荐答案

一段时间以后我就遇到了这个问题

I had faced this issue some time back

我解决这个问题的方式是

The way I solved this was

  • 从系统中删除IPython和Jupyter

  • Deleting IPython and Jupyter from the system

    rm -rf ~/.local/share/ipython

    重新安装IPython和Jupyter

    Reinstall IPython and Jupyter

  • 更多推荐

    sys.executable结果在终端和jupyter笔记本中有所不同

    本文发布于:2023-11-17 06:01:47,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1609086.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:有所不同   终端   笔记本   sys   executable

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!