Webapp2 importterror:无法导入name _thread



我试图从终端启动webapp2开发服务器,但我得到这个错误

> File "/Users/mertbarutcuoglu/Desktop/hellowebapp2/main.py", line 12,
> in main
>     from paste import httpserver   File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/paste/httpserver.py",
> line 29, in <module>
>     from six.moves import _thread ImportError: cannot import name _thread

下面是python脚本:

import webapp2
class HelloWebapp2(webapp2.RequestHandler):
    def get(self):
        self.response.write('Hello, webapp2!')
app = webapp2.WSGIApplication([
    ('/', HelloWebapp2),
], debug=True)
def main():
    from paste import httpserver
    httpserver.serve(app, host='127.0.0.1', port='8080')
if __name__ == '__main__':
    main() 

在Mac OS系统上运行这个似乎有一个问题。看到

https://github.com/pypa/pip/issues/3165

修复,我不得不卸载粘贴即sudo PIP卸载粘贴然后运行,Sudo PIP install paste——ignore-installed six

最新更新