Jupyter Notebook IPython DOES NOT WORK

I am in this part of the data science track:

https://www.codecademy.com/paths/data-science/tracks/dscp-python-fundamentals/modules/dscp-getting-started-off-platform/articles/setting-up-jupyter-notebook

It seems that Jupyter Notebook is required in this track, so I’m trying to get it working.

We are supposed to install Anaconda or Miniconda, and then open Jupyter Notebook. I installed Anaconda, and then opened Jupyter Notebook. We are supposed to create Python 3 (ipykernel) notebooks in Jupyter. But, every time I open a Python notebook, I cannot run any Python code in it. There are MANY kernel errors, and there is a bomb symbol which says “Kernel Dead”. These are the errors that show in Jupyter (I deleted parts of file paths) (I use Windows):

Traceback (most recent call last):
File “C:…\Python39\site-packages\tornado\web.py”, line 1704, in _execute
result = await result
File “C:…\Python39\site-packages\tornado\gen.py”, line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File “C:…\Python39\site-packages\notebook\services\sessions\handlers.py”, line 69, in post
model = yield maybe_future(
File “C:…\Python39\site-packages\tornado\gen.py”, line 762, in run
value = future.result()
File “C:…\Python39\site-packages\tornado\gen.py”, line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File “C:…\Python39\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 “C:…\Python39\site-packages\tornado\gen.py”, line 762, in run
value = future.result()
File “C:…\Python39\site-packages\tornado\gen.py”, line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File “C:…\Python39\site-packages\notebook\services\sessions\sessionmanager.py”, line 110, in start_kernel_for_session
kernel_id = yield maybe_future(
File “C:…\Python39\site-packages\tornado\gen.py”, line 762, in run
value = future.result()
File “C:…\Python39\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 “C:…\Python39\site-packages\jupyter_client\multikernelmanager.py”, line 186, in start_kernel
km.start_kernel(**kwargs)
File “C:…\Python39\site-packages\jupyter_client\manager.py”, line 337, in start_kernel
kernel_cmd, kw = self.pre_start_kernel(**kw)
File “C:…\Python39\site-packages\jupyter_client\manager.py”, line 286, in pre_start_kernel
self.write_connection_file()
File “C:…\Python39\site-packages\jupyter_client\connect.py”, line 466, in write_connection_file
self.connection_file, cfg = write_connection_file(self.connection_file,
File “C:…\Python39\site-packages\jupyter_client\connect.py”, line 136, in write_connection_file
with secure_write(fname) as f:
File “C:…\anaconda3\lib\contextlib.py”, line 119, in enter
return next(self.gen)
File “C:…\Python39\site-packages\jupyter_core\paths.py”, line 461, in secure_write
win32_restrict_file_to_user(fname)
File “C:…\Python39\site-packages\jupyter_core\paths.py”, line 387, in win32_restrict_file_to_user
import win32api
ImportError: DLL load failed while importing win32api: The specified procedure could not be found.

I already tried:

  • Uninstalled and reinstalled Anaconda. No effect.
  • Made web searches on this topic, and tried commands that were suggested. No effect.

I am OK at programming, but I am not a computer expert. I have NO IDEA how to fix these problems. I can’t be the only one who can’t get Jupyter Notebooks working! The instructions for setting it up don’t have any mention of any possible problems, as if it should just work as soon as it is installed! So, I am lost.

Did you restart the kernel? (on the menu: Kernel>restart and run all or restart).
What version of Windows?

Also, here’s some docs that might be of help:
https://jupyter-notebook.readthedocs.io/en/stable/troubleshooting.html

Also, as an alternative to Jupyter check out Google’s Colab. It’s an app that you add to your GDrive. It’s based on Jupyter and is pretty much the same thing.

I looks like I have finally solved this in a different way. Anaconda and Miniconda did not work for me. But, I found out how to install Jupyter Lab in a completely different way. I got the newest version of Python, then got pip and used it to install Jupyter Lab. Then I had to install the Python 3 ipykernel. Finally, I installed all of the packages we need, such as pandas and scikit-learn. This works now. It’s funny that I had to do this completely differently from what was recommended.