Problems when pyspider runs on python3.6

Everything went smoothly when pyspider was installed, but when it was running, it was found that the webui could not be started (that is, the web console could not
be seen). When installing the webui (pip install webui) alone, a bunch of things were installed. After the
installation was completed, the error was found when running pyspider webui: No module Named 'markupsafe._compat'
So check the markupsafe problem, search the file _compat.py and find that there is no markupsafe directory, so go online to find it.

Find the content of the _compat.py file:
# -*- 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()
Create a file _compat.py in the markupsafe directory, copy the content to this file and save it.
Rerunning pyspider 
works fine

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324928293&siteId=291194637