Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Data Science by (18.4k points)

Through homebrew, I have installed the python version 3.6.5_1. Then I realized that jupyter can be launched on 3.6 so I had to switch to python 3.7

When I launched jupyter the kernel is giving error as shown:

Traceback (most recent call last):

File "/usr/local/Cellar/jupyter/1.0.0_4/libexec/vendor/lib/python3.6/site-packages/tornado/web.py", line 1543, in _execute

result = yield result

File "/usr/local/Cellar/jupyter/1.0.0_4/libexec/vendor/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run

value = future.result()

File "/usr/local/Cellar/jupyter/1.0.0_4/libexec/vendor/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run

yielded = self.gen.throw(*exc_info)

File "/usr/local/Cellar/jupyter/1.0.0_4/libexec/lib/python3.6/site-packages/notebook/services/sessions/handlers.py", line 73, in post

type=mtype))

File "/usr/local/Cellar/jupyter/1.0.0_4/libexec/vendor/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run

value = future.result()

File "/usr/local/Cellar/jupyter/1.0.0_4/libexec/vendor/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run

yielded = self.gen.throw(*exc_info)

File "/usr/local/Cellar/jupyter/1.0.0_4/libexec/lib/python3.6/site-packages/notebook/services/sessions/sessionmanager.py", line 79, in create_session

kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)

File "/usr/local/Cellar/jupyter/1.0.0_4/libexec/vendor/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run

value = future.result()

File "/usr/local/Cellar/jupyter/1.0.0_4/libexec/vendor/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run

yielded = self.gen.throw(*exc_info)

File "/usr/local/Cellar/jupyter/1.0.0_4/libexec/lib/python3.6/site-packages/notebook/services/sessions/sessionmanager.py", line 92, in start_kernel_for_session

self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)

File "/usr/local/Cellar/jupyter/1.0.0_4/libexec/vendor/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run

value = future.result()

File "/usr/local/Cellar/jupyter/1.0.0_4/libexec/vendor/lib/python3.6/site-packages/tornado/gen.py", line 315, in wrapper

yielded = next(result)

File "/usr/local/Cellar/jupyter/1.0.0_4/libexec/lib/python3.6/site-packages/notebook/services/kernels/kernelmanager.py", line 148, in start_kernel

super(MappingKernelManager, self).start_kernel(**kwargs)

File "/usr/local/Cellar/jupyter/1.0.0_4/libexec/lib/python3.6/site-packages/jupyter_client/multikernelmanager.py", line 110, in start_kernel

km.start_kernel(**kwargs)

File "/usr/local/Cellar/jupyter/1.0.0_4/libexec/lib/python3.6/site-packages/jupyter_client/manager.py", line 259, in start_kernel

**kw)

File "/usr/local/Cellar/jupyter/1.0.0_4/libexec/lib/python3.6/site-packages/jupyter_client/manager.py", line 204, in _launch_kernel

return launch_kernel(kernel_cmd, **kw)

File "/usr/local/Cellar/jupyter/1.0.0_4/libexec/lib/python3.6/site-packages/jupyter_client/launcher.py", line 128, in launch_kernel

proc = Popen(cmd, **kwargs)

File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 709, in __init__

restore_signals, start_new_session)

File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 1344, in _execute_child

raise child_exception_type(errno_num, err_msg, err_filename)

FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/opt/python/bin/python3.7': '/usr/local/opt/python/bin/python3.7'

From my understanding, the kernel is looking for python version 3.7. It lists as:

$jupyter kernelspec list  

Available kernels:  

python3    /usr/local/etc/jupyter/kernels/python3  

1 Answer

0 votes
by (36.8k points)

You need to check the kernel specifications:

$jupyter kernelspec list

The below command will show you the available kernel.

python3    /usr/local/etc/jupyter/kernels/python3 

Now the kernel.json file in the above directory and provide the path of the python you wanted the kernel to work.

Improve your knowledge in data science from scratch using Data science online courses

Browse Categories

...