全新安装后无法运行apache气流

全新安装后无法运行apache气流

本文介绍了全新安装后无法运行apache气流,python导入错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 pip install apache-airflow 进行全新安装后,任何运行气流的尝试均会导致python导入错误:

after a fresh install using pip install apache-airflow, any attempts to run airflow end with a python import error:

Traceback (most recent call last):
File "/Users/\*/env/bin/airflow", line 26, in <module> from airflow.bin.cli import CLIFactory
File "/Users/\*/env/lib/python3.7/site-packages/airflow/bin/cli.py", line 70, in <module> from airflow.www.app import (cached_app, create_app)
File "/Users/\*/env/lib/python3.7/site-packages/airflow/www/app.py", line 26, in <module> from flask_wtf.csrf import CSRFProtect
File "/Users/\*/env/lib/python3.7/site-packages/flask_wtf/__init__.py", line 17, in <module> from .recaptcha import \*
File "/Users/\*/env/lib/python3.7/site-packages/flask_wtf/recaptcha/__init__.py", line 2, in <module> from .fields import \*
File "/Users/\*/env/lib/python3.7/site-packages/flask_wtf/recaptcha/fields.py", line 3, in <module> from . import widgets
File "/Users/\*/env/lib/python3.7/site-packages/flask_wtf/recaptcha/widgets.py", line 5, in <module> from werkzeug import url_encode
ImportError: cannot import name 'url_encode' from 'werkzeug' (/Users/*/env/lib/python3.7/site-packages/werkzeug/__init__.py)


推荐答案

这似乎是版本控制错误,werkzeug软件包的较新版本不再让气流寻找的url_encode,安装较低版本( pip install werkzeug == 0.16.0 )解决了该问题,气流现在可以正常运行。

It seemed to be a versioning error, the newer versions of the werkzeug package no longer have the url_encode that airflow is looking for, installing a lower version (pip install werkzeug==0.16.0) resolved the issue and airflow now runs without failing.

这篇关于全新安装后无法运行apache气流,python导入错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 18:11