Python:Python中Flask出现No module named 'markupsafe._compat'问题的解决方案
2018-02-20 22:25
711 查看
在Python的目录中,进入“\Lib\site-packages\markupsafe”文件夹,新建_compat.py文件,内容如下:
# -*- coding: utf-8 -*-
"""
markupsafe._compat
~~~~~~~~~~~~~~~~~~
Compatibility module for different Python versions.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
PY2 = sys.version_info[0] == 2
if not PY2:
text_type = str
string_types = (str,)
unichr = chr
int_types = (int,)
iteritems = lambda x: iter(x.items())
else:
text_type = unicode
string_types = (str, unicode)
unichr = unichr
int_types = (int, long)
iteritems = lambda x: x.iteritems()
# -*- coding: utf-8 -*-
"""
markupsafe._compat
~~~~~~~~~~~~~~~~~~
Compatibility module for different Python versions.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
PY2 = sys.version_info[0] == 2
if not PY2:
text_type = str
string_types = (str,)
unichr = chr
int_types = (int,)
iteritems = lambda x: iter(x.items())
else:
text_type = unicode
string_types = (str, unicode)
unichr = unichr
int_types = (int, long)
iteritems = lambda x: x.iteritems()
相关文章推荐
- 如何解决python中使用flask时遇到的markupsafe._compat包缺失的问题
- python中使用flask时遇到的markupsafe._compat包缺失的问题与解决
- [Django]Django1.7 Python3.4出现Error loading MySQLdb module:No module named ‘MySQLdb’问题
- python模块以及导入出现ImportError: No module named 'xxx'问题
- python模块以及导入出现ImportError: No module named 'xxx'问题
- python模块以及导入出现ImportError: No module named 'xxx'问题
- python模块以及导入出现ImportError: No module named 'xxx'问题
- python模块以及导入出现ImportError: No module named 'xxx'问题
- [Django]Django Python3出现Error loading MySQLdb module:No module named ‘MySQLdb’问题
- python模块以及导入出现ImportError: No module named 'xxx'问题
- python模块以及导入出现ImportError: No module named ‘xxx‘问题
- Django1.9 Python3.4出现Error loading MySQLdb module:No module named ‘MySQLdb’问题
- python模块以及导入出现ImportError: No module named 'xxx'问题
- python出现ImportError: No module named 'xxx'问题
- Mysql5.6 + Python 3.3遇到问题“ImportError: No module named 'mysql.connector'; mysql is not a package”
- Python调用SIFT,出现“No such file or directory: '***.sift'” 问题
- Python 第三方模块安装出现的问题和解决方案.
- 对于python中出现UnicodeDecodeError问题的解决方案
- centos7升级python,yum出现问题“ImportError: No module named urlgrabber.grabber”
- 从python2切换到python3.6环境后,出现No module named 'theano'错误