2020年2月24日 13:13 by wst
python调试
I’m getting this error when trying to use Airflow on WSL. Not sure what the issue is - I upgraded Flask & werkzeug.
File "/usr/local/bin/airflow", line 21, in <module> from airflow import configuration
File "/usr/local/lib/python3.5/dist-packages/airflow/__init__.py", line 40, in <module> from flask_admin import BaseView
File "/usr/local/lib/python3.5/dist-packages/flask_admin/__init__.py", line 6, in <module> from .base import expose, expose_plugview, Admin, BaseView, AdminIndexView # noqa: F401
File "/usr/local/lib/python3.5/dist-packages/flask_admin/base.py", line 6, in <module> from flask import Blueprint, current_app, render_template, abort, g, url_for
File "/usr/local/lib/python3.5/dist-packages/flask/__init__.py", line 21, in <module> from .app import Flask
File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 69, in <module> from .wrappers import Request
File "/usr/local/lib/python3.5/dist-packages/flask/wrappers.py", line 14, in <module> from werkzeug.wrappers.json import JSONMixin as _JSONMixin
ImportError: No module named 'werkzeug.wrappers.json'; **'werkzeug** .wrappers' is not a package
This is a bug that got introduce into Flask and worked its way into Airflow and one of our Docker images. You’ll need to do 1 of 2 things:
OR
requirements.txt
, pin Flask to “Flask=1.0.0”简单来说,解决方法就是(任选其一):
1. 修改dockfile的源为: astronomerinc/ap-airflow:0.9.2-1.10.3-onbuild
2. 安装flask的版本为1.0.0