AWS ec2 winreg not found

2019-02-23 21:48发布

问题:

I'm trying to run a python app from amazon EC2 large instance. However, Its complaining in scipy because it can't find a thing called _winreg.

I don't know how to reconfigure this so its no longer an issue.

$ python2 app.py
   * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
   * Restarting with stat  
Traceback (most recent call last):   
File "app.py", line 111, in <module> app = create_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 265, in run_with_reloader reloader.run()
File "/usr/local/lib/python2.7/dist-packages/werkzeug/_reloader.py", line 155, 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/scipy/lib/six.py", line 116, in __getattr__ _module = self._resolve()
File "/usr/lib/python2.7/dist-packages/scipy/lib/six.py", line 105, in _resolve return _import_module(self.mod)
File "/usr/lib/python2.7/dist-packages/scipy/lib/six.py", line 76, in _import_module __import__(name) ImportError: No module named _winreg """

回答1:

Check out the comments on the answer of this post.

I'm guessing by using the watchdog module it doesn't import "stat" which seems to look for this _winreg package.

In other words, installing the module "watchdog" seems to do the trick.