气流initdb失败:ImportError:没有名为log.logging_mixin的模块

时间:2018-03-28 21:16:37

标签: python installation pip airflow

我在没有root权限的计算机上安装了airflow 1.7.0。所有内容都安装在/ apps / dist /中,我是主人

$ pip install apache-airflow

我取得了很大的成功,直到这个:

Installing collected packages: webencodings, html5lib, bleach, configparser, flask-wtf, future, gunicorn, apache-airflow
  Found existing installation: Flask-WTF 0.12
    Uninstalling Flask-WTF-0.12:
      Successfully uninstalled Flask-WTF-0.12
  Found existing installation: future 0.15.2
    Uninstalling future-0.15.2:
      Successfully uninstalled future-0.15.2
  Found existing installation: gunicorn 19.3.0
    Uninstalling gunicorn-19.3.0:
      Successfully uninstalled gunicorn-19.3.0
Exception:
Traceback (most recent call last):
  File "/apps/dist/python/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/apps/dist/python/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/apps/dist/python/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/apps/dist/python/lib/python2.7/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/apps/dist/python/lib/python2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/apps/dist/python/lib/python2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/apps/dist/python/lib/python2.7/site-packages/pip/wheel.py", line 329, in clobber
    os.utime(destfile, (st.st_atime, st.st_mtime))
OSError: [Errno 1] Operation not permitted: '/apps/dist/python/lib/python2.7/site-packages/airflow/configuration.py'
You are using pip version 9.0.1, however version 9.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

所以我接受了他们的建议,并升级了点子:

$ pip install --upgrade pip
Collecting pip
  Downloading pip-9.0.3-py2.py3-none-any.whl (1.4MB)
    100% |████████████████████████████████| 1.4MB 826kB/s 
Installing collected packages: pip
  Found existing installation: pip 9.0.1
    Uninstalling pip-9.0.1:
      Successfully uninstalled pip-9.0.1
Successfully installed pip-9.0.3

然后我重新运行了pip install apache-airflow,得到了57行"要求已经满足"。下一步:

$ airflow initdb
Traceback (most recent call last):
  File "/apps/dist/python/bin/airflow", line 17, in <module>
    from airflow import configuration
  File "/apps/dist/python/lib/python2.7/site-packages/airflow/__init__.py", line 29, in <module>
    from airflow import configuration as conf
  File "/apps/dist/python/lib/python2.7/site-packages/airflow/configuration.py", line 31, in <module>
    from airflow.utils.log.logging_mixin import LoggingMixin
ImportError: No module named log.logging_mixin

我搜索了#34; ImportError:没有名为log.logging_mixin&#34;的模块,并得到了一堆点击讨论记录。所以我搜索了ImportError:没有名为&#34; log.logging_mixin&#34;的模块,基本没有点击。

我错过了什么?

1 个答案:

答案 0 :(得分:2)

所以,问题是pip在完成时会高估。

我卸载了气流,然后重新安装了它,并且pip抱怨/ apps / dist / python / bin / airflow的存在

再次卸载,删除/ apps / dist / python / bin / airflow,重新安装,现在一切正常