Jupyter does not work!

Hi guys, I am running my codes when I installed the library “nbinteract”. Then Jupyter Notebook does not work!
That is, when typing Jupyter Notebook into the kernel, it gives back logs like:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.11/bin/jupyter-notebook", line 5, in <module>
    from notebook.notebookapp import main
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/notebook/notebookapp.py", line 43, in <module>
    from jinja2 import Environment, FileSystemLoader
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/jinja2/__init__.py", line 12, in <module>
    from .environment import Environment
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/jinja2/environment.py", line 25, in <module>
    from .defaults import BLOCK_END_STRING
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/jinja2/defaults.py", line 3, in <module>
    from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/jinja2/filters.py", line 13, in <module>
    from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/markupsafe/__init__.py)

What else have you looked into and tried?

There’s quite a number of posts around discussing this issue, see the thread here for some clues. You may also want to try the Anaconda distribution and use Jupyter offerings in the Anaconda Navigator, and start using environments within Anaconda/conda. That way may keep you more insulated from issues caused if you install something that causes versions to shift in your environment and that way it doesn’t affect your entire system and cause issue like this.


Also, please don’t cross-post at multiple sites without linking to each and every similar post at each and every site. You potentially waste the time of multiple volunteer’s trying to help you. Also if a good answer is put in a reply at one site, others with the same issue later may not know the solution was provided elsewhere. At least if they are linked, the others later can check the related discussions. Keep in mind that the person you may end up helping find the answer could be a future version of yourself when you encounter the same problem perhaps a few months from now.