# Unable to run jupyter notebook

**URL:** <https://discourse.jupyter.org/t/unable-to-run-jupyter-notebook/25839>\
**Category:** JupyterHub\
**Tags:** help-wanted\
**Created:** [May 21, 2024, 9:26pm UTC](https://discourse.jupyter.org/t/unable-to-run-jupyter-notebook/25839 "2024-05-21T21:26:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aditya\_Shah](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/aditya_shah/32/10713_2.png) [@Aditya\_Shah](https://discourse.jupyter.org/u/Aditya_Shah)\
**Post date:** [May 21, 2024, 9:26pm UTC](https://discourse.jupyter.org/t/unable-to-run-jupyter-notebook/25839/1 "2024-05-21T21:26:42Z")

</div>

I keep trying to run it, and get this error. How can I fix this?

Traceback (most recent call last):

File “/Library/Frameworks/Python.framework/Versions/3.10/bin/jupyter-notebook”, line 5, in

```
from notebook.notebookapp import main

```

File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/notebook/notebookapp.py”, line 43, in

```
from jinja2 import Environment, FileSystemLoader

```

File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/jinja2/ **init**.py”, line 12, in

```
from .environment import Environment

```

File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/jinja2/environment.py”, line 25, in

```
from .defaults import BLOCK_END_STRING

```

File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/jinja2/defaults.py”, line 3, in

```
from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401

```

File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/jinja2/filters.py”, line 13, in

```
from markupsafe import soft_unicode

```

ImportError: cannot import name ‘soft\_unicode’ from ‘markupsafe’ (/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/markupsafe/ **init**.py)

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [May 22, 2024, 1:55am UTC](https://discourse.jupyter.org/t/unable-to-run-jupyter-notebook/25839/2 "2024-05-22T01:55:01Z")

</div>

> [@Aditya\_Shah](#):
>
> ImportError: cannot import name ‘soft\_unicode’ from ‘markupsafe’

I haven’t seen this come up in a while. Had things been working and now they aren’t? Any old software involved by any chance? What is your system and version?

We need to determine if this is a new issue or the one that came up quite a bit a while back.

I think if you had looked into troubleshooting this some on your own, we may be further along already to knowing if this is new or not. (I’d at least know some of the answers to the questions I posed above from your original post.) And so please read [Getting good answers to your questions](https://discourse.jupyter.org/t/getting-good-answers-to-your-questions/1825) to start to get a sense how to tackle these things. Under the section ‘_Before posting your question try_’, there is a good list to work though. If you had followed those steps you most likely would have found [this post ‘I am getting this launch error every time I am trying to open Jupyter Notebook’](https://discourse.jupyter.org/t/i-am-getting-this-launch-error-every-time-i-am-trying-to-open-jupyter-notebook/16141/2). In what you’d find in [a link there](https://stackoverflow.com/a/74371539/8508004), it suggests, after you close your Jupyter and browser and current terminal, running in your terminal:

```shell
pip install markupsafe==2.0.1 --force-reinstall

```

After that close that terminal window and then try opening Jupyter Notebook again. See if that helps.  
If it doesn’t then make a reply adding what happens, and provide the answers to some of my questions.

### But maybe you’d be better off at this point with something that is more ‘off the shelf’

An alternative, and perhaps a better way to go ( **meaning maybe you want to start here and bypass what looks to be a bit of a mess** ) follows …  
I suspect for some reason you may be on a Mac and not be aware that installing Jupyter on a Mac these days can be a challenge and there are a myriad ways to go about it. There are now a couple of pre-packaged software sets you can install that will handle things better for you, then you doing a lot of steps yourself.

- One perhaps easier option would be to install [the Anaconda Distribution](https://docs.anaconda.com/free/anaconda/index.html), which comes with Jupyter working already when you launch if from the Anaconda Navigator. However, as this is a package management system you are opting into, you want to read the Getting Started material and understand how they want to manage your environments for using with Jupyter. And you want to always from then on stick with using Anaconda/conda to install things. Only fall back to `pip` when there is no conda recipe. These two things are important to keep your environments robust and portable. And because that requires a bit more effort, others have cautioned me against suggesting this path. On the plus side, if you are willing to do that you get a set up Python and Jupyter, as well as other parts in a typical data science stack, all set up and working well together.

- Or instead of that you can install [JupyterLab Desktop](https://blog.jupyter.org/introducing-the-new-jupyterlab-desktop-bca1982bdb23), which is billed as, " the quickest and easiest way to get started with Jupyter notebooks on your personal computer." It is less of challenge the the Anaconda Distribution option, but you’ll still want to read all the material at that link to understand how the developers expect you to work with it on your projects.
