Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Knowledge Base

Definitive answers from Designer Desktop experts.

Error: "ImportError: cannot import name 'soft_unicode' from 'markupsafe'" when running Python tool

clarab
Alteryx
Alteryx
Created

Error: “ImportError: cannot import name 'soft_unicode' from 'markupsafe” when running Python tool

 

Environment Details

 

Python tool fails to load Jupyter Notebook and displays a blank page. When the workflow runs, it will fail at the Python tool with the following error. The same error is seen in the Jupyter Server log for the Python tool if logging is enabled.
 

Error: Python (1): Traceback (most recent call last):
  File "c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Program Files\Alteryx\bin\Miniconda3\envs\DesignerBaseTools_venv\Scripts\jupyter-nbconvert.EXE\__main__.py", line 4, in <module>
  File "c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\nbconvert\__init__.py", line 4, in <module>
    from .exporters import *
  File "c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\nbconvert\exporters\__init__.py", line 3, in <module>
    from .html import HTMLExporter
  File "c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\nbconvert\exporters\html.py", line 11, in <module>
    from jinja2 import contextfilter
  File "c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\jinja2\__init__.py", line 33, in <module>
    from jinja2.environment import Environment, Template
  File "c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\jinja2\environment.py", line 15, in <module>
    from jinja2 import nodes
  File "c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\jinja2\nodes.py", line 19, in <module>
    from jinja2.utils import Markup
  File "c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\jinja2\utils.py", line 647, in <module>
    from markupsafe import Markup, escape, soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\markupsafe\__init__.py)

 
  • Alteryx Designer, Server
    • Version: All

Blank Page:

image.pngimage.png

Cause

 

The MarkupSafe has been upgraded to the latest version (2.1.1) which causes the error.



Resolution

 

If the MarkupSafe package is upgraded due to a Python package, please check if you can use a lower MarkupSafe version. Version 2.0.0 works fine. Note that the MarkupSafe version that comes pre-installed with Alteryx Designer is 1.1.1. 


 

Additional Resources