markupsafe: Won't install on Windows
Python 3.6 (x86-64) pip == 9.0.1 setuptools == 34.3.2
(no36) D:\Git\project>pip install --force --upgrade markupsafe
Collecting markupsafe
Using cached MarkupSafe-1.0.tar.gz
Building wheels for collected packages: markupsafe
Running setup.py bdist_wheel for markupsafe ... error
Failed building wheel for markupsafe
Running setup.py clean for markupsafe
Failed to build markupsafe
Installing collected packages: markupsafe
Found existing installation: markupsafe 1.0
Uninstalling markupsafe-1.0:
Successfully uninstalled markupsafe-1.0
Running setup.py install for markupsafe ... error
Rolling back uninstall of markupsafe
Exception:
Traceback (most recent call last):
File "d:\python\no36\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 0xe9 in position 66: invalid continuation byte
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "d:\python\no36\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "d:\python\no36\lib\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "d:\python\no36\lib\site-packages\pip\req\req_set.py", line 784, in install
**kwargs
File "d:\python\no36\lib\site-packages\pip\req\req_install.py", line 878, in install
spinner=spinner,
File "d:\python\no36\lib\site-packages\pip\utils\__init__.py", line 676, in call_subprocess
line = console_to_str(proc.stdout.readline())
File "d:\python\no36\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 0xe9 in position 66: invalid continuation byte
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 17 (2 by maintainers)
Commits related to this issue
- handling sphinx dependencies storing raw wheels in repo to workaround https://github.com/pallets/markupsafe/issues/67 — committed to isogeo/isogeo-api-py-minsdk by Guts 6 years ago
Actually, the problem seems to come from missing wheel for MarkupSafe on Pypi. Creating it manually solved the issue for me. Here is the workaround (I use git-bash on Windows):
The result is a valid wheel:
/c/tmp/markupsafe/dist/MarkupSafe-1.0-cp36-cp36m-win_amd64.whl. In your other project where you need to use it, simply callAnd you’re done
Here is a simple solution. Since it is a decode error, it can be solved by changing the console’s coding to utf-8. Just run
and it works.
@OlegBrony It seems that Markupsafe is failed to build and install, but pip thinks it is already installed after the unsuccessful install. Maybe this issue only appears in Virtualenv environment. Please try to uninstall, ‘chcp 65001’, and install it again.
I also meet this question, I found this is just a decode error. In my environment, the console’s coding is ‘gbk’, and this return s.decode(‘utf-8’). so it make error. when I modify the source code to s.decode(‘gbk’). It works.
I had the same error with Python 3.6 on Windows 10 and @alorence’s solution fixed it.
I also saw this error. But I upgraded my pip to 10.0.1 and resolved problem. My pip verson is
pip 10.0.1 from python 3.6I’m using WIndows 10 now.I used “git bash” for reinstalation markupsafe and it helped me. No one UnicodeDecodeError
In case someone do have my issue:
@alorence’s solution fixed it all. Kudos to him for fixing an hours long issue.