我正在尝试使用LocalExecutor作为 MySQL 作为后端来设置气流。但在airflow initdb
我出错的时候
FutureWarning
/home/ubuntu/anaconda3/envs/airflow/lib/python3.6/site-packages/airflow/configuration.py:631: DeprecationWarning: Specifying both AIRFLOW_HOME environment variable and airflow_home in the config file is deprecated. Please use only the AIRFLOW_HOME environment variable and remove the config file entry.
warnings.warn(msg, category=DeprecationWarning)
[2020-02-21 14:27:31,056] {settings.py:253} INFO - settings.configure_orm(): Using pool settings. pool_size=0, max_overflow=10, pool_recycle=1800, pid=27346
Traceback (most recent call last):
File "/home/ubuntu/anaconda3/envs/airflow/bin/airflow", line 25, in <module>
from airflow.configuration import conf
File "/home/ubuntu/anaconda3/envs/airflow/lib/python3.6/site-packages/airflow/__init__.py", line 47, in <module>
settings.initialize()
File "/home/ubuntu/anaconda3/envs/airflow/lib/python3.6/site-packages/airflow/settings.py", line 377, in initialize
configure_orm()
File "/home/ubuntu/anaconda3/envs/airflow/lib/python3.6/site-packages/airflow/settings.py", line 266, in configure_orm
engine = create_engine(SQL_ALCHEMY_CONN, **engine_args)
File "/home/ubuntu/anaconda3/envs/airflow/lib/python3.6/site-packages/sqlalchemy/engine/__init__.py", line 479, in create_engine
return strategy.create(*args, **kwargs)
File "/home/ubuntu/anaconda3/envs/airflow/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 87, in create
dbapi = dialect_cls.dbapi(**dbapi_args)
File "/home/ubuntu/anaconda3/envs/airflow/lib/python3.6/site-packages/sqlalchemy/dialects/mysql/mysqldb.py", line 118, in dbapi
return __import__("MySQLdb")
ModuleNotFoundError: No module named 'MySQLdb'
所以我尝试使用命令安装 MySQLdb 在安装 MySQL-python 过程中出现错误 pip install MySQL-python
Collecting MySQL-python
Using cached MySQL-python-1.2.5.zip (108 kB)
ERROR: Command errored out with exit status 1:
command: /home/ubuntu/anaconda3/envs/airflow/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-51_ct34p/MySQL-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-51_ct34p/MySQL-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-51_ct34p/MySQL-python/pip-egg-info
cwd: /tmp/pip-install-51_ct34p/MySQL-python/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-51_ct34p/MySQL-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/tmp/pip-install-51_ct34p/MySQL-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.```
I have tried other way to install mysql-installation using pip
```sudo apt-get install python-mysqldb```
运行pip install 'apache-airflow[mysql]'
它会安装 Airflow 需要的所有 MySQL 依赖项。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句