简体   繁体   English

无法设置 jupyter notebook 没有模块

[英]Having trouble setting up jupyter notebook No Module

I am having trouble setting up jupyter notebook.我在设置 jupyter notebook 时遇到问题。 I installed pip, python, python3 and jupyter using pip3.我使用 pip3 安装了 pip、python、python3 和 jupyter。

I installed juypter by pip3 install jupyter我通过pip3 install jupyter

And I am trying to run notebook by jupyter notebook我正在尝试通过jupyter notebook运行jupyter notebook

However, I am getting an error但是,我收到一个错误

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/bin/jupyter", line 6, in <module>
    from jupyter_core.command import main
ModuleNotFoundError: No module named 'jupyter_core'

I been searching online for a long time but none of the solutions worked for me我在网上搜索了很长时间,但没有一个解决方案适合我

What I've tried:我试过的:

1. 1.

pip3 install --upgrade notebook
pip3 install lesscpy
which pip3
>>> /Library/Frameworks/Python.framework/Versions/3.8/bin/pip3
cd /Library/Frameworks/Python.framework/Versions/3.8/
./jupyer

same error

Any help would be appreciated.任何帮助,将不胜感激。

Cause I was running out of room in the comments....因为我在评论中的空间用完了......

So you can have many different copies of Python on your system in things called virtual environments .因此,您可以在称为虚拟环境的系统中拥有许多不同的 Python 副本。 The -m basically says hey for the Python at python (the default python in your system path) use the site-packages folder associated with it (the place all Python packages get installed to) and use the thing called jupyterlab . -m基本上是说,python 中的python (系统路径中的默认 Python)使用与其关联的 site-packages 文件夹(所有 Python 包安装到的位置)并使用名为jupyterlab的东西。

Now just doing jupyter notebook will use whatever thing is called jupyter that exists in your path.现在只是做jupyter notebook将使用任何存在于您的路径中的称为jupyter东西。 This might be the correct Jupyter install or it might be an install in a different copy of Python on your system.这可能是正确的 Jupyter 安装,也可能是安装在您系统上的不同 Python 副本中。 I wanted to make sure we were consistently using the same Python environment so that's why I said to do the -m .我想确保我们始终使用相同的 Python 环境,这就是我说要执行-m

Now the difference between jupyter notebook and jupyter lab (same as jupyterlab) is that Juypter Notebook was the original Notebook thing for Jupyter.现在jupyter notebookjupyter lab (与 jupyterlab 相同)之间的区别在于jupyter notebook Notebook 是 Jupyter 的原始 Notebook。 It was popular and people loved it and wanted more of it.它很受欢迎,人们喜欢它并想要更多。 So the devs took lessons learned and set out to basically create an entire IDE in the browser based around Jupyter Notebooks.因此,开发人员吸取了教训,并着手在基于 Jupyter Notebooks 的浏览器中基本上创建一个完整的 IDE。 I recommend Jupyter Lab over Jupyter Notebook as mostly a personal preference but really you get a lot more with Lab and ya might as well just use it instead.. if you did want to use the classic Notebook you can.. there's a launcher for it inside of Lab just look under I think the Help tab.我推荐 Jupyter Lab 而不是 Jupyter Notebook,因为这主要是个人偏好,但实际上你可以通过 Lab 获得更多,你也可以使用它来代替......如果你确实想使用经典的 Notebook,你可以......有一个启动器在实验室内部,只需查看我认为的“帮助”选项卡。

Hope this helped.希望这有帮助。 Good luck learning Python.祝你学习Python好运。 I always recommend checking out https://pythonprogramming.net to beginners.我总是建议初学者查看https://pythonprogramming.net He does great tutorials and you can learn all sorts of different things, everything from simple web development to AI to play Grand Theft Auto.他的教程很棒,您可以学习各种不同的东西,从简单的 Web 开发到 AI 再到玩侠盗猎车手,应有尽有。

PS聚苯乙烯

I also recommend you checkout something called Poetry .我还建议您查看名为Poetry 的东西。 It will help you with Virtual Environments... something you should learn to use early on...它将帮助您处理虚拟环境……您应该尽早学会使用的东西……

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM