Notebook: how can i fix raise child_exception_type(errno_num, err_msg, err_filename)

Created on 29 Mar 2018  路  8Comments  路  Source: jupyter/notebook

raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/opt/python3/bin/python3.6': '/usr/local/opt/python3/bin/python3.6'

-
jietu20180329-213857

jietu20180329-214005

Most helpful comment

Does /usr/local/opt/python3/bin/python3.6 exist? If not, you've probably created a kernel spec at some point when it did exist which points to it. Run jupyter kernelspec list to see where they are. There should be a path ending in python3. You can delete that, and it should fall back to using the Python which Jupyter is run on.

All 8 comments

Does /usr/local/opt/python3/bin/python3.6 exist? If not, you've probably created a kernel spec at some point when it did exist which points to it. Run jupyter kernelspec list to see where they are. There should be a path ending in python3. You can delete that, and it should fall back to using the Python which Jupyter is run on.

Hello @takluyver
I have the same issue, and getting the error ;

Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/tornado/web.py", line 1703, in _execute
result = await result
File "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 742, in run
yielded = self.gen.throw(exc_info) # type: ignore
File "/usr/local/lib/python3.6/dist-packages/notebook/services/sessions/handlers.py", line 72, in post
type=mtype))
File "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 735, in run
value = future.result()
File "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 742, in run
yielded = self.gen.throw(
exc_info) # type: ignore
File "/usr/local/lib/python3.6/dist-packages/notebook/services/sessions/sessionmanager.py", line 88, in create_session
kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
File "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 735, in run
value = future.result()
File "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "/usr/local/lib/python3.6/dist-packages/notebook/services/sessions/sessionmanager.py", line 101, in start_kernel_for_session
self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
File "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 735, in run
value = future.result()
File "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 209, in wrapper
yielded = next(result)
File "/usr/local/lib/python3.6/dist-packages/notebook/services/kernels/kernelmanager.py", line 168, in start_kernel
super(MappingKernelManager, self).start_kernel(kwargs)
File "/usr/local/lib/python3.6/dist-packages/jupyter_client/multikernelmanager.py", line 151, in start_kernel
km.start_kernel(
kwargs)
File "/usr/local/lib/python3.6/dist-packages/jupyter_client/manager.py", line 247, in start_kernel
self.write_connection_file()
File "/usr/local/lib/python3.6/dist-packages/jupyter_client/connect.py", line 474, in write_connection_file
kernel_name=self.kernel_name
File "/usr/local/lib/python3.6/dist-packages/jupyter_client/connect.py", line 138, in write_connection_file
with secure_write(fname) as f:
File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.6/dist-packages/jupyter_core/paths.py", line 447, in secure_write
.format(file=fname, permissions=oct(file_mode)))
RuntimeError: Permissions assignment failed for secure file: '/home/orod/.local/share/jupyter/runtime/kernel-6519f37d-8a6f-4981-812e-59f8be611015.json'. Got '0o677' instead of '0o0600'.

I have run this
root@gpu4:/usr/local/lib/python3.6/dist-packages/jupyter_core# jupyter kernelspec list
Available kernels:
anaconda /usr/local/share/jupyter/kernels/anaconda
python2 /usr/local/share/jupyter/kernels/python2
python3 /usr/local/share/jupyter/kernels/python3
root@gpu4:/usr/local/lib/python3.6/dist-packages/jupyter_core#

My question is what path should I remove?

I try to upgrade too.

root@gpu4:~# pip install jupyter_core --upgrade
Requirement already up-to-date: jupyter_core in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: traitlets in /usr/local/lib/python2.7/dist-packages (from jupyter_core)
Requirement already up-to-date: six in /usr/local/lib/python2.7/dist-packages (from traitlets->jupyter_core)
Requirement already up-to-date: enum34; python_version == "2.7" in /usr/local/lib/python2.7/dist-packages (from traitlets->jupyter_core)
Requirement already up-to-date: ipython-genutils in /usr/lib/python2.7/dist-packages (from traitlets->jupyter_core)
Requirement already up-to-date: decorator in /usr/local/lib/python2.7/dist-packages (from traitlets->jupyter_core)
root@gpu4:~# pip install jupyter_client --upgrade
Requirement already up-to-date: jupyter_client in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: python-dateutil>=2.1 in /usr/local/lib/python2.7/dist-packages (from jupyter_client)
Requirement already up-to-date: pyzmq>=13 in /usr/local/lib/python2.7/dist-packages (from jupyter_client)
Requirement already up-to-date: traitlets in /usr/local/lib/python2.7/dist-packages (from jupyter_client)
Requirement already up-to-date: jupyter-core>=4.6.0 in /usr/local/lib/python2.7/dist-packages (from jupyter_client)
Requirement already up-to-date: tornado>=4.1 in /usr/local/lib/python2.7/dist-packages (from jupyter_client)
Requirement already up-to-date: six>=1.5 in /usr/local/lib/python2.7/dist-packages (from python-dateutil>=2.1->jupyter_client)
Requirement already up-to-date: enum34; python_version == "2.7" in /usr/local/lib/python2.7/dist-packages (from traitlets->jupyter_client)
Requirement already up-to-date: ipython-genutils in /usr/lib/python2.7/dist-packages (from traitlets->jupyter_client)
Requirement already up-to-date: decorator in /usr/local/lib/python2.7/dist-packages (from traitlets->jupyter_client)
Requirement already up-to-date: futures in /usr/local/lib/python2.7/dist-packages (from tornado>=4.1->jupyter_client)
Requirement already up-to-date: singledispatch in /usr/local/lib/python2.7/dist-packages (from tornado>=4.1->jupyter_client)
Requirement already up-to-date: backports-abc>=0.4 in /usr/local/lib/python2.7/dist-packages (from tornado>=4.1->jupyter_client)

This issue is likely due to the use of a mounted filesystem that prevents file permission updates that Jupyter performs to secure the kernel's connection information. Please see https://github.com/jupyter/notebook/issues/5197#issuecomment-586614351 for options. #5058 also discusses this issue.

Hello, @kevin-bates Thanks for the information, I read most of your posts last night and thank you very much for spending your time to help and troubleshoot should this issue.

What I have done :
1) pip install jupyter_core --upgrade
2)pip install jupyter_client --upgrade
3)jupyter kernelspec list remove python3 and run jupyter,
this part in my kernal.json is
/usr/local/share/jupyter/kernels/python3# cat kernel.json
{
"argv": [
"/usr/bin/python3",
"-m",
"ipykernel_launcher",
"-f",
"{connection_file}"
],
"display_name": "Python 3",
"language": "python"

I did the test and change it to

/usr/local/share/jupyter/kernels/python3# cat kernel.json
{
"argv": [
"/usr/local/share/jupyter/kernels/python3",
"-m",
"ipykernel_launcher",
"-f",
"{connection_file}"
],
"display_name": "Python 3",
"language": "python"
}

But still, nothing working, we have 4 GPU and this is happening to all of them,

Thanks for your time and information.

This isn't about the kernelspec but rather the file that's written when the kernel is started. Your filesystem is preventing the setting of appropriate permissions, so you either need to change the location of where that file is written (via env JUPYTER_RUNTIME_DIR) or skip the enforcement of the permissions (via env JUPYTER_ALLOW_INSECURE_WRITES).

Thanks, @kevin-bates I read this on this article too https://github.com/jupyter/notebook/issues/5058
Sorry I had difficulty locating this env.

Could you please help me to find the location of this JUPYTER_RUNTIME_DIR and JUPYTER_ALLOW_INSECURE_WRITES, where is this environment file?

Thanks

Environment variables are named as such because their names (and values) are available to processes launched within that _environment_. The scope of an environment is typically a login shell and setting environment variables is more a less a function of the shell you're using. They are fundamental to Unix, but Windows also utilizes environment variables. You will find numerous hits googling how to set these.

If security is not a top priority, the easiest workaround is to set JUPYTER_ALLOW_INSECURE_WRITES=true. This needs to happen prior to launching your jupyter notebook command. So, in a terminal, issue the following...

export JUPYTER_ALLOW_INSECURE_WRITES=true
jupyter notebook

If you're more concerned about security, then you will need to locate a directory in a different filesystem than the one you are currently using other than under /home/orod/.local/ and probably /home/orod in general. For example purposes, I'm going to reference /tmp. So you would enter commands (similar to those before) like so...

export JUPYTER_RUNTIME_DIR=/tmp
jupyter notebook

Note that if you exit the terminal, you will lose the environment variable settings when creating another terminal session. To make the settings persistent, you would add them to a file like $HOME/.profile (depending on which shell you use (btw, HOME is an environment variable itself and $HOME is how to access its value; try echo $HOME and you'll find it has a value of '/home/orod')) then logout/login again to "activate" those settings. This kind of information will likely be found in your google search for how to set environment variables.

Thank you @kevin-bates, fix the issue for LDAP permission setting. Thank you very much, I learn how to set variable in Linux, as I am 2 years old in Linux, This was fundamental Information.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

toasteez picture toasteez  路  3Comments

arilwan picture arilwan  路  3Comments

mowe96 picture mowe96  路  3Comments

uolter picture uolter  路  3Comments

itoed picture itoed  路  3Comments