Apache Airflow : airflow initdb throws ModuleNotFoundError: No module named 'werkzeug.wrappers.json'; 'werkzeug.wrappers' is not a package error

孤人 提交于 2019-12-22 04:52:46

问题


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

tried pip3 install --upgrade Flask


回答1:


“pip3 install werkzeug==0.15.4” solved my problem. Seems that flask referenced the wrong version of werkzeug.




回答2:


running pip3 install -U Flask==1.0.4 fixed the issue. I guess there is some issue with Flask 1.1.0 which is affecting airflow.



来源:https://stackoverflow.com/questions/56933523/apache-airflow-airflow-initdb-throws-modulenotfounderror-no-module-named-wer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!