flask dropbox导致错误:ImportError:没有名为_winreg的模块

时间:2015-03-17 05:53:09

标签: python flask dropbox dropbox-api

因此,每当我将Dropbox导入我的Flask项目时,都会收到此错误。

例如,即使在示例项目中, https://github.com/WoLpH/dropbox/blob/master/example/flask_app/simple_dropbox_app.py

我怀疑错误是由这一行引起的:

12 DEBUG = True

但我不知道为什么。这是我在没有修改的情况下运行示例项目时得到的错误。

/Downloads/dropbox-master/example/flask_app$ python simple_dropbox_app.py 
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 * Restarting with stat
Traceback (most recent call last):
  File "simple_dropbox_app.py", line 167, in <module>
    main()
  File "simple_dropbox_app.py", line 163, in main
    app.run()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 772, in run
    run_simple(host, port, self, **options)
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 622, in run_simple
    reloader_type)
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/_reloader.py", line 269, in run_with_reloader
    reloader.run()
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/_reloader.py", line 159, in run
    for filename in chain(_iter_module_files(), self.extra_files):
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/_reloader.py", line 70, in _iter_module_files
    for package_path in getattr(module, '__path__', ()):
  File "/usr/lib/python2.7/dist-packages/six.py", line 116, in __getattr__
    _module = self._resolve()
  File "/usr/lib/python2.7/dist-packages/six.py", line 105, in _resolve
    return _import_module(self.mod)
  File "/usr/lib/python2.7/dist-packages/six.py", line 76, in _import_module
    __import__(name)
ImportError: No module named _winreg
  

ImportError:没有名为_winreg的模块

1 个答案:

答案 0 :(得分:1)

只需sudo pip install flask --upgrade。最新版本修复了这个错误!