0

我已经安装了flask-socketio

当我尝试运行数字时,它向我显示以下错误

digits/webapp.py:7: ExtDeprecationWarning: Importing flask.ext.socketio is deprecated, use flask_socketio instead.
  from flask.ext.socketio import SocketIO
Traceback (most recent call last):
  File "/home/sam/anaconda2/envs/testcaffe/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/home/sam/anaconda2/envs/testcaffe/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/sam/DIGITS/digits/__main__.py", line 70, in <module>
    main()
  File "/home/sam/DIGITS/digits/__main__.py", line 55, in main
    import digits.webapp
  File "digits/webapp.py", line 7, in <module>
    from flask.ext.socketio import SocketIO
  File "/home/sam/anaconda2/envs/testcaffe/lib/python2.7/site-packages/flask/exthook.py", line 110, in load_module
    raise ImportError('No module named %s' % fullname)
ImportError: No module named flask.ext.socketio

如何解决这个问题?谢谢

4

1 回答 1

0

你可以这样做: sudo apt-get install python-flaskext.socketio

在该错误之后,您可能会遇到另一个错误: ImportError: No module named flask.ext.wtf 您可以通过以下方式修复:sudo apt-get install python-flaskext.wtf

可能您能做的最好的事情就是使用正确的数字要求文件来安装所有依赖项。

pip install -r requirements.txt

于 2017-06-10T13:56:05.917 回答