Python 气流初始化数据库失败:导入错误:没有名为log.logging\u mixin的模块

Python 气流初始化数据库失败:导入错误:没有名为log.logging\u mixin的模块,python,installation,pip,airflow,Python,Installation,Pip,Airflow,我在一台没有root访问权限的机器上安装了airflow 1.7.0。所有内容都安装在/apps/dist/中,我是其所有者 跑 在这之前,我取得了很大的成功: Installing collected packages: webencodings, html5lib, bleach, configparser, flask-wtf, future, gunicorn, apache-airflow Found existing installation: Flask-WTF 0.12

我在一台没有root访问权限的机器上安装了airflow 1.7.0。所有内容都安装在/apps/dist/中,我是其所有者

在这之前,我取得了很大的成功:

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:

$ 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安装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
$initdb
回溯(最近一次呼叫最后一次):
文件“/apps/dist/python/bin/afflow”,第17行,在
从气流导入配置
文件“/apps/dist/python/lib/python2.7/site packages/afflow/_init__.py”,第29行,在
从气流导入配置为conf
文件“/apps/dist/python/lib/python2.7/site packages/afflow/configuration.py”,第31行,在
从afflow.utils.log.logging\u mixin导入LoggingMixin
ImportError:没有名为log.logging\u mixin的模块
我搜索了“ImportError:没有名为log.logging\u mixin的模块”,得到了一大堆关于讨论日志的点击。所以我搜索了ImportError:没有名为“log.logging\u mixin”的模块,基本上没有找到任何命中率


我遗漏了什么?

所以,问题是pip在它完成时高估了它

我卸载了airflow,然后重新安装,pip抱怨存在/apps/dist/python/bin/airflow

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

$ 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