Home > Blockchain >  jupyter notebook showing this message, ImportError: cannot import name 'encodestring' from
jupyter notebook showing this message, ImportError: cannot import name 'encodestring' from

Time:11-12

I am new to python and jupyter notebook and I am using windows. Recently I installed Anaconda Navigator 2.3.1 and the python verson 3.9.13 on my computer. After entering the command jupyter notebook on the command-line, my browser doesn't open jupyter notebook, instead that showing me this error message:

(base) C:\Users\USER>jupyter notebook
Traceback (most recent call last):
  File "D:\Anaconda3\anaconda3\Scripts\jupyter-notebook-script.py", line 6, in <module>
    from notebook.notebookapp import main
  File "D:\Anaconda3\anaconda3\lib\site-packages\notebook\notebookapp.py", line 79, in <module>
    from .services.contents.manager import ContentsManager
  File "D:\Anaconda3\anaconda3\lib\site-packages\notebook\services\contents\manager.py", line 17, in <module>
    from nbformat import sign, validate as validate_nb, ValidationError
  File "C:\Users\USER\AppData\Roaming\Python\Python39\site-packages\nbformat\__init__.py", line 14, in <module>
    from . import v1
  File "C:\Users\USER\AppData\Roaming\Python\Python39\site-packages\nbformat\v1\__init__.py", line 19, in <module>
    from .nbjson import reads as reads_json, writes as writes_json
  File "C:\Users\USER\AppData\Roaming\Python\Python39\site-packages\nbformat\v1\nbjson.py", line 19, in <module>
    from base64 import encodestring
ImportError: cannot import name 'encodestring' from 'base64' (D:\Anaconda3\anaconda3\lib\base64.py)

I don't understand what should do now? And how to solve this issue! Please help..........

CodePudding user response:

base64.encodestring was deprecated since python 3.1 and finally removed in 3.9

You can compare the official documentation for the base64 library for version 3.8 and 3.9

https://docs.python.org/3.8/library/base64.html https://docs.python.org/3.9/library/base64.html

I'm not sure exactly how you installed anaconda navigator but i would suggest using the latest distribution of anaconda which includes navigator

  • Related