![](/img/trans.png)
[英]Inspite of installing tensorflow, `ModuleNotFoundError: No module named 'tensorflow'` error occurs when I try to run files from CMD
[英]i try to install flask on my windows cmd and i got UnicodeDecodeError when installing MarkupSafe module
我嘗試在Windows cmd上安裝Flask,並且在安裝MarkupSafe模塊時收到UnicodeDecodeError
Exception:
Traceback (most recent call last):
File "c:\python36\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 5: invalid continuation byte
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\python36\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "c:\python36\lib\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "c:\python36\lib\site-packages\pip\req\req_set.py", line 784, in install
**kwargs
File "c:\python36\lib\site-packages\pip\req\req_install.py", line 878, in install
spinner=spinner,
File "c:\python36\lib\site-packages\pip\utils\__init__.py", line 676, in call_subprocess
line = console_to_str(proc.stdout.readline())
File "c:\python36\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 5: invalid continuation byte
問題出在Pypi上缺少MarkupSafe的車輪。 這是解決方法(在Windows上為git-bash):
git clone git@github.com:pallets/markupsafe.git /c/tmp/markupsafe
cd /c/tmp/markupsafe
./setup.py bdist_wheel
The result is a valid wheel: /c/tmp/markupsafe/dist/MarkupSafe-1.0-cp36-cp36m-win_amd64.whl.
在您需要使用它的其他項目中,只需調用
pip install /c/tmp/markupsafe/dist/MarkupSafe-1.0-cp36-cp36m-win_amd64.whl
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.