M220P Jupyter Startup Error

I have a Manjaro machine running anaconda and used the pip to install all requirements.txt file.

In Chapter 1 : Lecture Mongo Client when I run
jupyter notebook
I get an assert. The client is running Python 3.9, so I wondered if I need to get an older version of Python for this course. Here is the full stack.

Traceback (most recent call last):
  File "/home/nathan/.local/bin/jupyter-notebook", line 5, in <module>
    from notebook.notebookapp import main
  File "/home/nathan/.local/lib/python3.9/site-packages/notebook/notebookapp.py", line 83, in <module>
    from .services.contents.manager import ContentsManager
  File "/home/nathan/.local/lib/python3.9/site-packages/notebook/services/contents/manager.py", line 17, in <module>
    from nbformat import sign, validate as validate_nb, ValidationError
  File "/home/nathan/.local/lib/python3.9/site-packages/nbformat/__init__.py", line 14, in <module>
    from . import v1
  File "/home/nathan/.local/lib/python3.9/site-packages/nbformat/v1/__init__.py", line 19, in <module>
    from .nbjson import reads as reads_json, writes as writes_json
  File "/home/nathan/.local/lib/python3.9/site-packages/nbformat/v1/nbjson.py", line 19, in <module>
    from base64 import encodestring
ImportError: cannot import name 'encodestring' from 'base64' (/usr/lib/python3.9/base64.py)
1 Like

Hi @nathan_Turner,

We have not tested M220P with Python 3.9 and looking specifically at your error, I discovered that base64.encodestring has been deprecated since Python 3.1 (per the Python Docs) but more importantly for your client environment, it was removed completely in Python 3.9 (see the Python Docs changelog for 3.9).

The easiest and quickest solution to this issue is to change your client environment to Python 3.8 and this will allow you to complete the course.

Thanks for flagging this and we’ll add this as a note.

Kindest regards,


This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.