您的位置:首页 > 编程语言 > Python开发

pyspider 运行在python3.6时的问题

2018-04-27 05:16 281 查看
pyspider安装时一切顺利,但是在运行时发现webui启动不了(即看不到网页控制台)
单独安装webui (pip install webui)时安装了一堆东西
安装完成后再运行 pyspider webui时发现错误:No module named 'markupsafe._compat'
于是检查markupsafe问题,搜文件_compat.py发现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()
在markupsafe目录下创建文件_compat.py,内容复制到此文件中保存。
重新运行pyspider
运行正常
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python pyspider