本文介绍了Apache Airflow:气流initdb抛出ModuleNotFoundError:没有名为“ werkzeug.wrappers.json”的模块; 'werkzeug.wrappers'不是软件包错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在具有python 3.6.8的Ubuntu 18.04上,尝试安装气流。当我运行airflow initdb命令时,抛出以下错误
On Ubuntu 18.04 with python 3.6.8, trying to install airflow. When I ran airflow initdb command, below error is thrown
Traceback (most recent call last):
File "/home/uEnAFpip/.virtualenvs/airflow/bin/airflow", line 21, in <module>
from airflow import configuration
File "/home/uEnAFpip/.virtualenvs/airflow/lib/python3.6/site-packages/airflow/__init__.py", line 40, in <module>
from flask_admin import BaseView
File "/home/uEnAFpip/.virtualenvs/airflow/lib/python3.6/site-packages/flask_admin/__init__.py", line 6, in <module>
from .base import expose, expose_plugview, Admin, BaseView, AdminIndexView # noqa: F401
File "/home/uEnAFpip/.virtualenvs/airflow/lib/python3.6/site-packages/flask_admin/base.py", line 6, in <module>
from flask import Blueprint, current_app, render_template, abort, g, url_for
File "/home/uEnAFpip/.virtualenvs/airflow/lib/python3.6/site-packages/flask/__init__.py", line 20, in <module>
from .app import Flask
File "/home/uEnAFpip/.virtualenvs/airflow/lib/python3.6/site-packages/flask/app.py", line 69, in <module>
from .wrappers import Request
File "/home/uEnAFpip/.virtualenvs/airflow/lib/python3.6/site-packages/flask/wrappers.py", line 14, in <module>
from werkzeug.wrappers.json import JSONMixin as _JSONMixin
ModuleNotFoundError: No module named 'werkzeug.wrappers.json'; 'werkzeug.wrappers' is not a package
尝试过pip3 install --upgrade Flask
tried pip3 install --upgrade Flask
推荐答案
pip3 install werkzeug == 0.15.4解决了我的问题。
似乎烧瓶引用了错误版本的werkzeug。
"pip3 install werkzeug==0.15.4" solved my problem.Seems that flask referenced the wrong version of werkzeug.
这篇关于Apache Airflow:气流initdb抛出ModuleNotFoundError:没有名为“ werkzeug.wrappers.json”的模块; 'werkzeug.wrappers'不是软件包错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!