Python-kenel error:PermissionError: [Errno 13] Permission denied: - python

I set a enviroment of tensorflow. I wanna to check whether it works well.So I open the Jupyter Notebook
When I open Jupyter Notebook and establish a new file, it show kenel error.
Traceback (most recent call last):
File "D:\Anaconda3\envs\tensor36\lib\site-packages\tornado\web.py", line 1699, in _execute
result = await result
File "D:\Anaconda3\envs\tensor36\lib\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "D:\Anaconda3\envs\tensor36\lib\site-packages\notebook\services\sessions\handlers.py", line 72, in post
type=mtype))
File "D:\Anaconda3\envs\tensor36\lib\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "D:\Anaconda3\envs\tensor36\lib\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "D:\Anaconda3\envs\tensor36\lib\site-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 "D:\Anaconda3\envs\tensor36\lib\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "D:\Anaconda3\envs\tensor36\lib\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "D:\Anaconda3\envs\tensor36\lib\site-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 "D:\Anaconda3\envs\tensor36\lib\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "D:\Anaconda3\envs\tensor36\lib\site-packages\tornado\gen.py", line 209, in wrapper
yielded = next(result)
File "D:\Anaconda3\envs\tensor36\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 168, in start_kernel
super(MappingKernelManager, self).start_kernel(**kwargs)
File "D:\Anaconda3\envs\tensor36\lib\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
km.start_kernel(**kwargs)
File "D:\Anaconda3\envs\tensor36\lib\site-packages\jupyter_client\manager.py", line 240, in start_kernel
self.write_connection_file()
File "D:\Anaconda3\envs\tensor36\lib\site-packages\jupyter_client\connect.py", line 547, in write_connection_file
kernel_name=self.kernel_name
File "D:\Anaconda3\envs\tensor36\lib\site-packages\jupyter_client\connect.py", line 212, in write_connection_file
with secure_write(fname) as f:
File "D:\Anaconda3\envs\tensor36\lib\contextlib.py", line 81, in __enter__
return next(self.gen)
File "D:\Anaconda3\envs\tensor36\lib\site-packages\jupyter_client\connect.py", line 102, in secure_write
with os.fdopen(os.open(fname, open_flag, 0o600), mode) as f:
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\Huazhi\\AppData\\Roaming\\jupyter\\runtime\\kernel-c1e93dc8-b336-4fdd-a028-7c001460bc4f.json'

Maybe this can solve this problem:
When starting Anaconda Prompt, right-click and select "use administrator account to run the program", then input "jupyter notebook" and press Enter to open the Notebook, it can be used normally.

Try to downgrade your jupyter notebook to version 5.3.1 .
conda install jupyter_client=5.3.1

Related

PyCharm - Jupyter Notebooks - DLL Load failed : The specified module could not be found

I have recently started using PyCharm (Pycharm 2020.1.1) for all things Python, and followed the instructions give here :
https://www.jetbrains.com/help/pycharm/jupyter-notebook-support.html#get-started
However, I am still getting the following error while trying to run any cell in the Jupyter notebook on PyCharm. I even tried running an empty cell to see if it was an issue with any libraries I was importing, however, it stilll throws the same error :
Traceback (most recent call last):
File "c:\users\viraj\pycharmprojects\orion-constellation\venv\lib\site-packages\tornado\web.py", line 1703, in _execute
result = await result
File "c:\users\viraj\pycharmprojects\orion-constellation\venv\lib\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "c:\users\viraj\pycharmprojects\orion-constellation\venv\lib\site-packages\notebook\services\sessions\handlers.py", line 72, in post
type=mtype))
File "c:\users\viraj\pycharmprojects\orion-constellation\venv\lib\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "c:\users\viraj\pycharmprojects\orion-constellation\venv\lib\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "c:\users\viraj\pycharmprojects\orion-constellation\venv\lib\site-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 "c:\users\viraj\pycharmprojects\orion-constellation\venv\lib\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "c:\users\viraj\pycharmprojects\orion-constellation\venv\lib\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "c:\users\viraj\pycharmprojects\orion-constellation\venv\lib\site-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 "c:\users\viraj\pycharmprojects\orion-constellation\venv\lib\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "c:\users\viraj\pycharmprojects\orion-constellation\venv\lib\site-packages\tornado\gen.py", line 209, in wrapper
yielded = next(result)
File "c:\users\viraj\pycharmprojects\orion-constellation\venv\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 168, in start_kernel
super(MappingKernelManager, self).start_kernel(**kwargs)
File "c:\users\viraj\pycharmprojects\orion-constellation\venv\lib\site-packages\jupyter_client\multikernelmanager.py", line 158, in start_kernel
km.start_kernel(**kwargs)
File "c:\users\viraj\pycharmprojects\orion-constellation\venv\lib\site-packages\jupyter_client\manager.py", line 301, in start_kernel
kernel_cmd, kw = self.pre_start_kernel(**kw)
File "c:\users\viraj\pycharmprojects\orion-constellation\venv\lib\site-packages\jupyter_client\manager.py", line 248, in pre_start_kernel
self.write_connection_file()
File "c:\users\viraj\pycharmprojects\orion-constellation\venv\lib\site-packages\jupyter_client\connect.py", line 474, in write_connection_file
kernel_name=self.kernel_name
File "c:\users\viraj\pycharmprojects\orion-constellation\venv\lib\site-packages\jupyter_client\connect.py", line 138, in write_connection_file
with secure_write(fname) as f:
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2032.0_x64__qbz5n2kfra8p0\lib\contextlib.py", line 112, in __enter__
return next(self.gen)
File "c:\users\viraj\pycharmprojects\orion-constellation\venv\lib\site-packages\jupyter_core\paths.py", line 435, in secure_write
win32_restrict_file_to_user(fname)
File "c:\users\viraj\pycharmprojects\orion-constellation\venv\lib\site-packages\jupyter_core\paths.py", line 361, in win32_restrict_file_to_user
import win32api
ImportError: DLL load failed: The specified module could not be found.
What could be the possible cause and the solution for this ?
The problem is with 'pyzmq'
Do the following
pip uninstall pyzmq (u might get permission denied, kindly ignore it.)
pip install pyzmq
Click on "register this interpreter as jupyter kernel" (prompt by pycharm).
This worked for me, hopefully works for you too. :)

How to solve the problem in jupyter notebook "Fail to start the kernel"

When trying to launch a jupyter notebook using python version 3.7.4 I run into the following error:
Failed to start the kernel message is...
Traceback (most recent call last):
File "C:\Users\felixkim1023\AppData\Local\Continuum\anaconda3\lib\site-packages\tornado\web.py", line 1699, in _execute
result = await result
File "C:\Users\felixkim1023\AppData\Local\Continuum\anaconda3\lib\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "C:\Users\felixkim1023\AppData\Local\Continuum\anaconda3\lib\site-packages\notebook\services\sessions\handlers.py", line 72, in post
type=mtype))
File "C:\Users\felixkim1023\AppData\Local\Continuum\anaconda3\lib\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "C:\Users\felixkim1023\AppData\Local\Continuum\anaconda3\lib\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "C:\Users\felixkim1023\AppData\Local\Continuum\anaconda3\lib\site-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 "C:\Users\felixkim1023\AppData\Local\Continuum\anaconda3\lib\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "C:\Users\felixkim1023\AppData\Local\Continuum\anaconda3\lib\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "C:\Users\felixkim1023\AppData\Local\Continuum\anaconda3\lib\site-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 "C:\Users\felixkim1023\AppData\Local\Continuum\anaconda3\lib\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "C:\Users\felixkim1023\AppData\Local\Continuum\anaconda3\lib\site-packages\tornado\gen.py", line 209, in wrapper
yielded = next(result)
File "C:\Users\felixkim1023\AppData\Local\Continuum\anaconda3\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 168, in start_kernel
super(MappingKernelManager, self).start_kernel(**kwargs)
File "C:\Users\felixkim1023\AppData\Local\Continuum\anaconda3\lib\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
km.start_kernel(**kwargs)
File "C:\Users\felixkim1023\AppData\Local\Continuum\anaconda3\lib\site-packages\jupyter_client\manager.py", line 240, in start_kernel
self.write_connection_file()
File "C:\Users\felixkim1023\AppData\Local\Continuum\anaconda3\lib\site-packages\jupyter_client\connect.py", line 547, in write_connection_file
kernel_name=self.kernel_name
File "C:\Users\felixkim1023\AppData\Local\Continuum\anaconda3\lib\site-packages\jupyter_client\connect.py", line 212, in write_connection_file
with secure_write(fname) as f:
File "C:\Users\felixkim1023\AppData\Local\Continuum\anaconda3\lib\contextlib.py", line 112, in __enter__
return next(self.gen)
File "C:\Users\felixkim1023\AppData\Local\Continuum\anaconda3\lib\site-packages\jupyter_client\connect.py", line 102, in secure_write
with os.fdopen(os.open(fname, open_flag, 0o600), mode) as f:
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\felixkim1023\\AppData\\Roaming\\jupyter\\runtime\\kernel-0a76fc02-0376-4747-a88f-0effa941a976.json'
How do I solve this problem?
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\felixkim1023\\AppData\\Roaming\\jupyter\\runtime\\kernel-0a76fc02-0376-4747-a88f-0effa941a976.json'
This sentence is pretty clear, you don't have permission. If you are in a bash shell be sure to run your command with sudo, i.e:
sudo jupyter notebook
If you're not (e.g. you're in a Windows Powershell) be sure to launch the shell as administrator (right-click launch as administrator).

Python, Jupyter note book kernel error no

Traceback (most recent call last):
File "C:\Users\yahia\AppData\Roaming\Python\Python37\site-packages\tornado\web.py", line 1699, in _execute
result = await result
File "C:\Users\yahia\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "C:\Users\yahia\AppData\Roaming\Python\Python37\site-packages\notebook\services\sessions\handlers.py", line 72, in post
type=mtype))
File "C:\Users\yahia\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "C:\Users\yahia\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "C:\Users\yahia\AppData\Roaming\Python\Python37\site-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 "C:\Users\yahia\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "C:\Users\yahia\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "C:\Users\yahia\AppData\Roaming\Python\Python37\site-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 "C:\Users\yahia\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "C:\Users\yahia\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 209, in wrapper
yielded = next(result)
File "C:\Users\yahia\AppData\Roaming\Python\Python37\site-packages\notebook\services\kernels\kernelmanager.py", line 168, in start_kernel
super(MappingKernelManager, self).start_kernel(**kwargs)
File "C:\Users\yahia\AppData\Roaming\Python\Python37\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
km.start_kernel(**kwargs)
File "C:\Users\yahia\AppData\Roaming\Python\Python37\site-packages\jupyter_client\manager.py", line 240, in start_kernel
self.write_connection_file()
File "C:\Users\yahia\AppData\Roaming\Python\Python37\site-packages\jupyter_client\connect.py", line 476, in write_connection_file
kernel_name=self.kernel_name
File "C:\Users\yahia\AppData\Roaming\Python\Python37\site-packages\jupyter_client\connect.py", line 141, in write_connection_file
with secure_write(fname) as f:
File "C:\Users\yahia\Anaconda3\lib\contextlib.py", line 112, in __enter__
return next(self.gen)
File "C:\Users\yahia\AppData\Roaming\Python\Python37\site-packages\jupyter_core\paths.py", line 404, in secure_write
win32_restrict_file_to_user(fname)
File "C:\Users\yahia\AppData\Roaming\Python\Python37\site-packages\jupyter_core\paths.py", line 359, in win32_restrict_file_to_user
import win32api
ImportError: DLL load failed: The specified procedure could not be found.
It was working good yesterday, but today I don't know why I get this error as I'm new to Python at all
Absolutely! Try conda uninstall jupyter notebook in the CLI and then install it again using conda install jupyter

Kernel error (Errno 13 Permission denied) in Jupyter Notebook, Windows 10

I have installed Jupyter Notebook on Windows 10. I can execute jupyter notebook command. It opens and shows a list of current path directories. I also can create or open a notebook. But when I do it I get Kernel error in the top right corner. After clicking on it this window appears:
Failed to start the kernel
Unhandled error
Traceback (most recent call last):
File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\tornado\web.py", line 1699, in _execute
result = await result
File "c:\users\lola\appdata\local\programs\python\python35\lib\asyncio\futures.py", line 383, in __iter__
return self.result() # May raise too.
File "c:\users\lola\appdata\local\programs\python\python35\lib\asyncio\futures.py", line 294, in result
raise self._exception
File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\notebook\services\sessions\handlers.py", line 72, in post
type=mtype))
File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "c:\users\lola\appdata\local\programs\python\python35\lib\asyncio\futures.py", line 294, in result
raise self._exception
File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "c:\users\lola\appdata\local\programs\python\python35\lib\site-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 "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "c:\users\lola\appdata\local\programs\python\python35\lib\asyncio\futures.py", line 294, in result
raise self._exception
File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "c:\users\lola\appdata\local\programs\python\python35\lib\site-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 "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "c:\users\lola\appdata\local\programs\python\python35\lib\asyncio\futures.py", line 294, in result
raise self._exception
File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\tornado\gen.py", line 209, in wrapper
yielded = next(result)
File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 168, in start_kernel
super(MappingKernelManager, self).start_kernel(**kwargs)
File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
km.start_kernel(**kwargs)
File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\jupyter_client\manager.py", line 240, in start_kernel
self.write_connection_file()
File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\jupyter_client\connect.py", line 547, in write_connection_file
kernel_name=self.kernel_name
File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\jupyter_client\connect.py", line 212, in write_connection_file
with secure_write(fname) as f:
File "c:\users\lola\appdata\local\programs\python\python35\lib\contextlib.py", line 59, in __enter__
return next(self.gen)
File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\jupyter_client\connect.py", line 102, in secure_write
with os.fdopen(os.open(fname, open_flag, 0o600), mode) as f:
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\Lola\\AppData\\Roaming\\jupyter\\runtime\\kernel-fd884f4e-8208-4b8e-9db2-c048f869e042.json'
The code in my file is not highlighted in different colors and when I run it nothing happens.
I am new to programming, so please try to give advice in simple words, describing each step in detail.
In the past, I've tried to delete Python, install Python in different versions, install Anaconda. In addition, in order to work with tensorflow, I've created a special environment. But this error stays the same. I suspect the problem is a double backslash ("//") in the path, but I have absolutely no idea how to fix this. But perhaps the problem is something else.
Same exact problem here. What worked for me was running the Anaconda Navigator as an Administrator. Hope it works for you too.
This problems occurred since the last update of the jupyter_client.
You can temporarily solve the issue by downgrading to the last version.
conda install jupyter_client=5.3.1

How to fix Anaconda Jupyter Notebook kernel error?

The kernel error appearing on my anaconda juppyter notebook.
I have tried to change " shell:False" to "shell:True", but it didn't work.
Traceback (most recent call last):
File "C:\Users\Lenovo\Anaconda3\lib\site-packages\tornado\web.py", line 1699, in _execute
result = await result
File "C:\Users\Lenovo\Anaconda3\lib\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "C:\Users\Lenovo\Anaconda3\lib\site-packages\notebook\services\sessions\handlers.py", line 72, in post
type=mtype))
File "C:\Users\Lenovo\Anaconda3\lib\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "C:\Users\Lenovo\Anaconda3\lib\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "C:\Users\Lenovo\Anaconda3\lib\site-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 "C:\Users\Lenovo\Anaconda3\lib\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "C:\Users\Lenovo\Anaconda3\lib\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "C:\Users\Lenovo\Anaconda3\lib\site-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 "C:\Users\Lenovo\Anaconda3\lib\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "C:\Users\Lenovo\Anaconda3\lib\site-packages\tornado\gen.py", line 209, in wrapper
yielded = next(result)
File "C:\Users\Lenovo\Anaconda3\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 168, in start_kernel
super(MappingKernelManager, self).start_kernel(**kwargs)
File "C:\Users\Lenovo\Anaconda3\lib\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
km.start_kernel(**kwargs)
File "C:\Users\Lenovo\Anaconda3\lib\site-packages\jupyter_client\manager.py", line 259, in start_kernel
**kw)
File "C:\Users\Lenovo\Anaconda3\lib\site-packages\jupyter_client\manager.py", line 204, in _launch_kernel
return launch_kernel(kernel_cmd, **kw)
File "C:\Users\Lenovo\Anaconda3\lib\site-packages\jupyter_client\launcher.py", line 138, in launch_kernel
proc = Popen(cmd, **kwargs)
File "C:\Users\Lenovo\Anaconda3\lib\subprocess.py", line 775, in init
restore_signals, start_new_session)
File "C:\Users\Lenovo\Anaconda3\lib\subprocess.py", line 1178, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the specific file.
actually the environment that you made then you must have deleted them , there were refrences for those envs ,
soultion : used this in cmd :
python -m ipykernel install --user
see this for more help:
here

Categories