【问题标题】:ERROR: Command errored out with exit status 1: python setup.py egg_info Check while install MySQL-python错误:命令错误退出状态 1:python setup.py egg_info 安装 MySQL-python 时检查
【发布时间】:2020-02-21 14:30:38
【问题描述】:

我正在尝试使用 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```  

【问题讨论】:

    标签: python mysql airflow


    【解决方案1】:

    运行 pip install 'apache-airflow[mysql]',它将安装 Airflow 所需的所有 MySQL 依赖项。

    【讨论】:

      猜你喜欢
      • 2021-04-15
      • 1970-01-01
      • 2021-02-20
      • 2022-01-18
      • 2018-08-08
      • 2020-04-07
      • 1970-01-01
      • 2020-02-17
      • 2021-07-30
      相关资源
      最近更新 更多