Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

airflow

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

like image 785
Mohan Avatar asked Jul 08 '19 11:07

Mohan


1 Answers

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

like image 163
Hongjia Avatar answered Sep 23 '22 00:09

Hongjia