Issue
I am having trouble setting up jupyter notebook. I installed pip, python, python3 and jupyter using pip3.
I installed juypter by pip3 install jupyter
And I am trying to run notebook by 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.
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.
Solution
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. 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
.
Now just doing jupyter notebook
will use whatever thing is called jupyter
that exists in your path. This might be the correct Jupyter install or it might be an install in a different copy of Python on your system. I wanted to make sure we were consistently using the same Python environment so that's why I said to do the -m
.
Now the difference between jupyter notebook
and jupyter lab
(same as jupyterlab) is that Juypter Notebook was the original Notebook thing for Jupyter. 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. 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.
Hope this helped. Good luck learning Python. I always recommend checking out https://pythonprogramming.net to beginners. 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.
P.S.
I also recommend you checkout something called Poetry. It will help you with Virtual Environments... something you should learn to use early on...
Answered By - Matt Camp
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.