A
A
Alexey Lvov2017-03-26 01:23:14
Flask
Alexey Lvov, 2017-03-26 01:23:14

Flask: how to remove error when installing MarkupSafe on Win10 via cmd/pip?

What to do, how to decide?
Deploying flask on my home machine...
pip install flask

Everything is going well.
But when it comes to installing the MarkupSafe package , this is what happens:

Installing collected packages: markupsafe
  Running setup.py install for markupsafe ... error
Exception:
Traceback (most recent call last):
  File "c:\users\user\appdata\local\programs\python\python36-32\lib\site-packages\pip\compat\__init__.py", line 73, in console_to_str
    return s.decode(sys.__stdout__.encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd1 in position 3: invalid continuation byte
During handling of the above exception, another exception occurred: ...


Next on the command line is a list of recent calls, and this is what it ends up with:

line = console_to_str(proc.stdout.readline())
  File "c:\users\user\appdata\local\programs\python\python36-32\lib\site-packages\pip\compat\__init__.py", line 75, in console_to_str
    return s.decode('utf_8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd1 in position 3: invalid continuation byte

... and so on (I can attach the rest of the listing).

As a result, when I try to run a web application with Flask imports, I get this:

from markupsafe import Markup, escape, soft_unicode
  File "C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\site-packages\markupsafe\__init__.py", line 14, in <module>
    from markupsafe._compat import text_type, string_types, int_types, \
ModuleNotFoundError: No module named 'markupsafe._compat'


All other add-on packages within Flask install fine.
Tried uninstalling MarkupSafe and installing it separately - same problem.

Please help me to understand and solve the problem.
PS With flask worked before, but such an error during installation is the first time.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2017-03-26
@schizw

First, try updating pip:
If that doesn't work, download the appropriate wheel for your system from here and try installing it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question