PTVS
PTVS copied to clipboard
An error "cannot import name 'soft_unicode' from 'markupsafe'"pops up when launch Flask project.
Environment

Steps to Reproduce
- Create a new Flask Web Project
- And click "Create virtual environment" from the notification message

- When after installing the environment successfully, press F5 to launch the project
- Observes
Expected behavior The project launched successfully without any error.
Additional context and screenshots
An error pops up.

Output
cannot import name 'soft_unicode' from 'markupsafe' (C:\Users\vyizh12\source\repos\FlaskWebProject5\FlaskWebProject5\env\lib\site-packages\markupsafe\__init__.py)
Stack trace:
> File "C:\Users\vyizh12\source\repos\FlaskWebProject5\FlaskWebProject5\FlaskWebProject5\__init__.py", line 5, in <module> (Current frame)
> from flask import Flask
> File "C:\Users\vyizh12\source\repos\FlaskWebProject5\FlaskWebProject5\runserver.py", line 6, in <module>
> from FlaskWebProject5 import app
Loaded 'jinja2.filters'
Loaded 'jinja2.defaults'
Loaded 'jinja2.environment'
Loaded 'jinja2'
Loaded 'flask'
Loaded 'FlaskWebProject5'
Loaded '__main__'
Loaded 'runpy'
The program 'python.exe' has exited with code 0 (0x0).
I have exactly the same problem with conan, which also uses jinja2! Seems, that there is an error in the official pip mirror.
https://github.com/pallets/markupsafe/issues/284