Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

  1. First Step - export AIRFLOW_HOME=~/airflow (No error)

  2. Second Step - pip install apache-airflow (No error)

  3. Third Step - airflow initdb ( Error - ImportError: cannot import name '_psutil_linux')

Detailed of error is shown in below image:

enter image description here

Environment detail is as below-

  • Python Version - Python 3.6.3 :: Anaconda custom (32-bit)
  • Pip Version - 10.0.1
  • Ubuntu Version - 14.04 LTS
  • OS Type - 32 bits

How should I go on resolving it? I have already tried updating pip and installing python-dev but that does not work.

like image 329
kavi pandya Avatar asked Jun 03 '18 22:06

kavi pandya


2 Answers

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:

apt-get update
apt-get --only-upgrade install python-psutil
apt-get install python-psutil
like image 166
Benyamin Jafari Avatar answered Nov 08 '22 19:11

Benyamin Jafari


installing python-dev will do the job

if you are running ubuntu then sudo apt-get install python-dev

or simply running pip install -U psutil should do the job.

like image 2
gruby Avatar answered Nov 08 '22 19:11

gruby