PTVS icon indicating copy to clipboard operation
PTVS copied to clipboard

An error "cannot import name 'soft_unicode' from 'markupsafe'"pops up when launch Flask project.

Open linette-zyy opened this issue 4 years ago • 2 comments

Environment image

Steps to Reproduce

  1. Create a new Flask Web Project
  2. And click "Create virtual environment" from the notification message image
  3. When after installing the environment successfully, press F5 to launch the project
  4. Observes

Expected behavior The project launched successfully without any error.

Additional context and screenshots An error pops up. image

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).

linette-zyy avatar Feb 18 '22 07:02 linette-zyy

I have exactly the same problem with conan, which also uses jinja2! Seems, that there is an error in the official pip mirror.

stefanweiser avatar Feb 18 '22 08:02 stefanweiser

https://github.com/pallets/markupsafe/issues/284

janikarki avatar Feb 18 '22 08:02 janikarki