B L Praveen
B L Praveen

Reputation: 2010

Jupyter Notebook Kernal Error win32api not found

I installed Jupyter notebook from my terminal by typing in cmd: jupyter notebook it opened Jupyter notebook in the browser. I opened a new python3 notebook enter image description here

In the top shows Kernel error. I have attached the error below enter image description here

     Traceback (most recent call last):
        File "d:\laragon\bin\python\python-3.9.4-embed-amd64\Lib\site-packages\tornado\web.py", line 1704, in _execute
          result = await result
        File "d:\laragon\bin\python\python-3.9.4-embed-amd64\Lib\site-packages\tornado\gen.py", line 769, in run
          yielded = self.gen.throw(*exc_info)  # type: ignore
        File "d:\laragon\bin\python\python-3.9.4-embed-amd64\Lib\site-packages\notebook\services\sessions\handlers.py", line 69, in post
          model = yield maybe_future(
        File "d:\laragon\bin\python\python-3.9.4-embed-amd64\Lib\site-packages\tornado\gen.py", line 762, in run
          value = future.result()
        File "d:\laragon\bin\python\python-3.9.4-embed-amd64\Lib\site-packages\tornado\gen.py", line 769, in run
          yielded = self.gen.throw(*exc_info)  # type: ignore
        File "d:\laragon\bin\python\python-3.9.4-embed-amd64\Lib\site-packages\notebook\services\sessions\sessionmanager.py", line 98, in create_session
          kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
        File "d:\laragon\bin\python\python-3.9.4-embed-amd64\Lib\site-packages\tornado\gen.py", line 762, in run
          value = future.result()
        File "d:\laragon\bin\python\python-3.9.4-embed-amd64\Lib\site-packages\tornado\gen.py", line 769, in run
          yielded = self.gen.throw(*exc_info)  # type: ignore
        File "d:\laragon\bin\python\python-3.9.4-embed-amd64\Lib\site-packages\notebook\services\sessions\sessionmanager.py", line 110, in start_kernel_for_session
          kernel_id = yield maybe_future(
        File "d:\laragon\bin\python\python-3.9.4-embed-amd64\Lib\site-packages\tornado\gen.py", line 762, in run
          value = future.result()
        File "d:\laragon\bin\python\python-3.9.4-embed-amd64\Lib\site-packages\notebook\services\kernels\kernelmanager.py", line 176, in start_kernel
          kernel_id = await maybe_future(self.pinned_superclass.start_kernel(self, **kwargs))
        File "d:\laragon\bin\python\python-3.9.4-embed-amd64\Lib\site-packages\jupyter_client\multikernelmanager.py", line 186, in start_kernel
          km.start_kernel(**kwargs)
        File "d:\laragon\bin\python\python-3.9.4-embed-amd64\Lib\site-packages\jupyter_client\manager.py", line 337, in start_kernel
          kernel_cmd, kw = self.pre_start_kernel(**kw)
        File "d:\laragon\bin\python\python-3.9.4-embed-amd64\Lib\site-packages\jupyter_client\manager.py", line 286, in pre_start_kernel
          self.write_connection_file()
        File "d:\laragon\bin\python\python-3.9.4-embed-amd64\Lib\site-packages\jupyter_client\connect.py", line 466, in write_connection_file
          self.connection_file, cfg = write_connection_file(self.connection_file,
        File "d:\laragon\bin\python\python-3.9.4-embed-amd64\Lib\site-packages\jupyter_client\connect.py", line 136, in write_connection_file
          with secure_write(fname) as f:
        File "contextlib.py", line 117, in __enter__
        File "d:\laragon\bin\python\python-3.9.4-embed-amd64\Lib\site-packages\jupyter_core\paths.py", line 461, in secure_write
          win32_restrict_file_to_user(fname)
        File "d:\laragon\bin\python\python-3.9.4-embed-amd64\Lib\site-packages\jupyter_core\paths.py", line 387, in win32_restrict_file_to_user
          import win32api
      ModuleNotFoundError: No module named 'win32api'

I am using Windows 10 64bit. I googled and tried all the solutions still I get this error

I tried

pip install pywin32 version 225 because I could not find version 224.

My installed python version is 3.9.4

When I run this command

D:\laragon\bin\python\python-3.9.4-embed-amd64\Scripts>python pywin32_postinstall.py -install

Can't install shortcuts -

'C:\\Users\\He\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Python 3.9' is not a folder

Upvotes: 0

Views: 454

Answers (2)

Joshua Stevens
Joshua Stevens

Reputation: 1

I uninstalled the python and jupyter notebook extensions in vscode and reinstalled Anaconda and that worked for me.

Upvotes: 0

Jeevaramanan M
Jeevaramanan M

Reputation: 21

its because you have open jupyter notebook on vscode . the kernal dir has been changed from anaconda jupyter notebook to vscode jupyter notebook

you have to change the directory vscode to anaconda

Upvotes: 2

Related Questions