Cylc 8.0rc1 gui fails due to markupsafe ImportError

I installed cylc vi conda and tried using the gui. Running ‘cylc gui’ produces the following:

Traceback (most recent call last):
File “/glade/u/home/bcash/.conda/envs/cylc8rc1/bin/cylc”, line 10, in
sys.exit(main())
File “/glade/u/home/bcash/.conda/envs/cylc8rc1/lib/python3.9/site-packages/cylc/flow/scripts/cylc.py”, line 539, in main
execute_cmd(command, *cmd_args)
File “/glade/u/home/bcash/.conda/envs/cylc8rc1/lib/python3.9/site-packages/cylc/flow/scripts/cylc.py”, line 172, in execute_cmd
COMMANDS[cmd].resolve()(*args)
File “/glade/u/home/bcash/.conda/envs/cylc8rc1/lib/python3.9/site-packages/pkg_resources/init.py”, line 2464, in resolve
module = import(self.module_name, fromlist=[‘name’], level=0)
File “/glade/u/home/bcash/.conda/envs/cylc8rc1/lib/python3.9/site-packages/cylc/uiserver/init.py”, line 21, in
from cylc.uiserver.app import CylcUIServer
File “/glade/u/home/bcash/.conda/envs/cylc8rc1/lib/python3.9/site-packages/cylc/uiserver/app.py”, line 37, in
from jupyter_server.extension.application import ExtensionApp
File “/glade/u/home/bcash/.conda/envs/cylc8rc1/lib/python3.9/site-packages/jupyter_server/extension/application.py”, line 5, in
from jinja2 import Environment
File “/glade/u/home/bcash/.conda/envs/cylc8rc1/lib/python3.9/site-packages/jinja2/init.py”, line 12, in
from .environment import Environment
File “/glade/u/home/bcash/.conda/envs/cylc8rc1/lib/python3.9/site-packages/jinja2/environment.py”, line 25, in
from .defaults import BLOCK_END_STRING
File “/glade/u/home/bcash/.conda/envs/cylc8rc1/lib/python3.9/site-packages/jinja2/defaults.py”, line 3, in
from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401
File “/glade/u/home/bcash/.conda/envs/cylc8rc1/lib/python3.9/site-packages/jinja2/filters.py”, line 13, in
from markupsafe import soft_unicode
ImportError: cannot import name ‘soft_unicode’ from ‘markupsafe’ (/glade/u/home/bcash/.conda/envs/cylc8rc1/lib/python3.9/site-packages/markupsafe/init.py)

I saw the note about markupsafe with pip - is there also potentially an issue when installing via conda?

Hello,

This is due to a bug in Jinja2 that is beyond our control.

We have pushed a patch to Conda to work around the issue, if you arer installing from PyPi you will need to specify a version for one of the Jinja2 dependencies. Details in the installation section:

https://cylc.github.io/cylc-doc/latest/html/installation.html#admonition-3

I installed via conda but now I know I didn’t actually get rc1, so I imagine that is the cause of this problem. I was able to install rc1 by using their conda module but it is complaining about incompatibilities with uiserver. I may have to do my own miniconda install to get around this at this rate.

so I imagine that is the cause of this problem

Yes, the beta releases have not been patched to solve the Jinja2 bug.

I was able to install rc1 by using their conda module but it is complaining about incompatibilities with uiserver

Providing you were installing in a clean environment, this would suggest that Conda was unable to satisfy the dependencies of the UI Server on your platform, which would be surprising.

Might be a good idea to try installing from one of the example environment files (or a modification there of) as these are regularly tested and we can then reproduce the exact installation at our end.

conda env create -f <file>

That did the trick - no idea why it wasn’t working from the command line but I’ll take it. :slight_smile: Thanks!