简体   繁体   English

Python-导入paypalrestsdk导致ImportError:没有名为_winreg的模块

[英]Python - Importing paypalrestsdk causes ImportError: No module named _winreg

Any time I try to import paypalrestsdk in a python file, I get 每当我尝试在python文件中导入paypalrestsdk时,我都会

Traceback (most recent call last):
  File "runserver.py", line 3, in <module>
    app.run(debug=True)
  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

I'm using Flask and the import was in the routes.py, but I got the same error when I put the import in the init .py 我正在使用Flask并且导入在routes.py中,但是将导入放入init .py中时遇到了相同的错误

Install the module watchdog or downgrade the werkzeug's version. 安装模块看门狗或降级werkzeug的版本。 There seems to be some issues with the latest werzeug's version as explained here AWS ec2 winreg not found 最新的werzeug版本似乎存在一些问题,如此处所述, 未找到AWS ec2 winreg

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM