Vispr error can not import Markup from jinja2
Hello, i've installed mageck-vispr (using miniconda) on a mac and have been following the tutorials to get it up an running. Everything was fine until I called vispr at which point it threw this error:
$ vispr --version Traceback (most recent call last): File "/Users/nkuperwasser/miniconda3/envs/macgeckv/bin/vispr", line 6, in <module> from vispr.cli import main File "/Users/nkuperwasser/miniconda3/envs/macgeckv/lib/python3.7/site-packages/vispr/cli.py", line 28, in <module> from vispr.server import app File "/Users/nkuperwasser/miniconda3/envs/macgeckv/lib/python3.7/site-packages/vispr/server.py", line 13, in <module> from jinja2 import Markup ImportError: cannot import name 'Markup' from 'jinja2' (/Users/nkuperwasser/miniconda3/envs/macgeckv/lib/python3.7/site-packages/jinja2/init.py)
Indeed examination of the jinja2_init file does not show Markup...is there something that I have missed during the installation?
Thank you in advance.
NK
Comments (4)
-
-
Hi, I found using the mamba install and then making the following fix to some of the files (to fix a different bug that will come up but that has been resolved elsewhere here) Copied:
Hello,
I had the same error. I edited the files server.py and cli.py and then it worked.
go to this directory: /Applications/miniconda3/envs/mageck-vispr/lib/python3.6/site-packages/vispr/ and open the file server.py with a text editor (e.g. emacs) and go to line 23. change yaml.load(f) to yaml.safe_load(f)
Do the same for the file cli.py line 40.
This should solve the problems.
-
Hi all,
I am running into similar issues. When I ran the demo, everything went well until I used the following command "vispr server results/*.vispr.yaml". I then got the following error: "ImportError: cannot import name 'Markup' from 'jinja2'(/opt/anaconda3/envs/mageck-vispr/lib/python3.9/site-packages/jinja2/__init__.py)". I have tried to follow different solutions:
- Uninstalling/Re-installing Jinja2 and Flask
- Upgrading and downgrading Jinja2/Anaconda
- Installing mamba to install mageck vispr: this solution got stuck in solving the environment ("Solving environment: failed with initial frozen solve. Retrying with flexible solve"). At that point, I created a new environment, which could install mamba but was unable to install mageck vispr ("Encountered problems while solving:- nothing provides openssl >=1.1.1,<1.1.2.0a0 needed by python-2.7.15-h8f8e585_2").
At this point, I do not know how to proceed since I cannot find any other solutions online.
Thank you!
-
hi all,
follow Emily Madden 's comments,
you need to do these extra changes,
maybe you can try to open the ../miniconda3/envs/macgeckv/lib/python3.7/site-packages/vispr/server.py in the edtior
change the
from jinja2 import Markup
to
from markupsafe import Markup
save and
try again
- Log in to comment
Hello, I’ve been trying to resolve this issue the last 2 days as well. I also recently installed using miniconda on a Mac. Perhaps this is a machine specific error during installation?
EM