还是报错:Usage: flask run [OPTIONS] Try 'flask run --help' for help. Error: While importing 'main', an ImportError was raised: Traceback (most recent call last): File "/opt/anaconda3/lib/python3.9/site-packages/flask/cli.py", line 218, in locate_app __import__(module_name) File "/root/ahjd_zypc_flask/main.py", line 17, in <module> myapp = create_app(Config) File "/root/ahjd_zypc_flask/app/__init__.py", line 63, in create_app register_blueprints(app) File "/root/ahjd_zypc_flask/app/__init__.py", line 31, in register_blueprints app.register_blueprint(import_module('app.authenticate').blueprint) File "/opt/anaconda3/lib/python3.9/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/root/ahjd_zypc_flask/app/authenticate.py", line 23, in <module> from docx import Document ModuleNotFoundError: No module named 'docx'
时间: 2024-04-10 13:28:34 浏览: 177
根据报错信息来看,你的代码在导入 `docx` 模块时出现了错误,提示找不到该模块。这说明你的环境中没有安装 `docx` 模块。
你可以通过运行以下命令来安装 `docx` 模块:
```
pip install python-docx
```
安装完成后,再次运行代码应该就不会出现这个错误了。
阅读全文