Issue
I have previously installed python 3.7 from python.org and later installed anaconda python distribution. When I launch the Jupyter notebook the kernel is failing to get connected. What could be the problem I tried reinstalling but it didn't work.
Below is the error I got.
[I 00:23:53.252 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports
Traceback (most recent call last):
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python37\lib\site-packages\ipykernel_launcher.py", line 15, in <module>
from ipykernel import kernelapp as app
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python37\lib\site-packages\ipykernel\__init__.py", line 2, in <module>
from .connect import *
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python37\lib\site-packages\ipykernel\connect.py", line 13, in <module>
from IPython.core.profiledir import ProfileDir
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python37\lib\site-packages\IPython\__init__.py", line 54, in <module>
from .core.application import Application
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python37\lib\site-packages\IPython\core\application.py", line 25, in <module>
from IPython.core import release, crashhandler
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python37\lib\site-packages\IPython\core\crashhandler.py", line 27, in <module>
from IPython.core import ultratb
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python37\lib\site-packages\IPython\core\ultratb.py", line 115, in <module>
from IPython.core import debugger
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python37\lib\site-packages\IPython\core\debugger.py", line 47, in <module>
from pdb import Pdb as OldPdb
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python37\lib\pdb.py", line 76, in <module>
import code
File "C:\Users\lenovo\Desktop\HW1_Q1\code.py", line 5, in <module>
"execution_count": null,
NameError: name 'null' is not defined
[W 00:23:56.368 NotebookApp] KernelRestarter: restart failed
[W 00:23:56.368 NotebookApp] Kernel 3087f4f8-f452-476b-becc-41f53a23cf80 died, removing from map.
Solution
- Create a conda environment,
- install Python + Jupyter in it using conda,
- activate the conda environment
Conda makes sure that the installed components fit together.. on a Linux os for example there's more than one Python installed
Besides,
Can you run jupyter notebook
without specifying a file?
Answered By - ohlr
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.