在具有python 3.6.8的Ubuntu 18.04上,尝试安装气流。当我运行airflow initdb命令时,抛出以下错误
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
答案 0 :(得分:4)
“ pip3 install werkzeug == 0.15.4”解决了我的问题。 似乎烧瓶引用了错误版本的werkzeug。
答案 1 :(得分:3)
运行pip3 install -U Flask==1.0.4
解决了该问题。我猜Flask 1.1.0出现了一些问题,影响了气流。