简体   繁体   English

Apache Airflow 导入错误:无法导入名称“_psutil_linux”

[英]Apache Airflow ImportError: cannot import name '_psutil_linux'

I am installing apache airflow as per the installation steps provided at https://airflow.apache.org/start.html#quick-start我正在按照https://airflow.apache.org/start.html#quick-start提供的安装步骤安装 apache 气流

  1. First Step - export AIRFLOW_HOME=~/airflow (No error)第一步 - export AIRFLOW_HOME=~/airflow (无错误)

  2. Second Step - pip install apache-airflow (No error)第二步 - pip install apache-airflow (无错误)

  3. Third Step - airflow initdb ( Error - ImportError: cannot import name '_psutil_linux' )第三步 - airflow initdb (错误 - ImportError: cannot import name '_psutil_linux'

Detailed of error is shown in below image:错误的详细信息如下图所示:

在此处输入图片说明

Environment detail is as below-环境细节如下-

  • Python Version - Python 3.6.3 :: Anaconda custom (32-bit) Python 版本 - Python 3.6.3 :: Anaconda 自定义(32 位)
  • Pip Version - 10.0.1点子版本 - 10.0.1
  • Ubuntu Version - 14.04 LTS Ubuntu 版本 - 14.04 LTS
  • OS Type - 32 bits操作系统类型 - 32 位

How should I go on resolving it?我应该如何继续解决它? I have already tried updating pip and installing python-dev but that does not work.我已经尝试过更新 pip 并安装 python-dev 但这不起作用。

installing python-dev will do the job安装python-dev将完成这项工作

if you are running ubuntu then sudo apt-get install python-dev如果您正在运行 ubuntu,则sudo apt-get install python-dev

or simply running pip install -U psutil should do the job.或者简单地运行pip install -U psutil应该可以完成这项工作。

I've overcome this problem through the following command:我已经通过以下命令克服了这个问题:

pip install -U --ignore-installed psutil

This works if you have installed psutil by pip , otherwise, try via apt in Ubuntu:如果您已通过pip安装了psutil ,则此方法有效,否则,请在 Ubuntu 中通过apt尝试:

apt-get update
apt-get --only-upgrade install python-psutil
apt-get install python-psutil

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM