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
运行正常
单独安装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
运行正常
相关文章推荐
- python3.6安装pyspider出现的问题(pycurl安装失败)和解决方案
- python3.6安装pyspider出现的问题
- python3.6的tkinter运行问题
- 在Ubuntu14.04和Python3.4-3.6环境中,matplotlib不显示图像的问题的解决方法
- python类继承时构造函数的运行问题
- CentOS 7安装Python 3.6,pip3报错问题
- 一步一步搞定Python3.6编码问题
- Python 运行cv2中出现的问题
- hive 0.8运行python脚本问题
- python2.7web代码用python3.6运行时,浏览器发送请求报错TypeError: Object of type 'bytes' is not JSON serializable的解决办法
- module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.6问题解决
- “带锁的门”问题,并有c语言和python代码运行效率对比
- python selenium运行,打包exe常见问题解决方法
- 【linux】crontab运行python脚本遇到的问题
- pyspider部署以及遇到的问题(on centos7 with python3.5)
- win10系统64位python3.6第三方库安装问题
- Python3.6笔记之将程序运行结果输出到文件
- python MySQLdb 问题 - 程序已的后台运行每90秒获取数据,却无法获取最新的值
- python3.6 nmap模块的安装问题
- sublime text3--解决python代码运行是不能交互的问题