0

Hi I am trying to install Airflow in my Linux VM (Ubuntu 16.04) inside a Virtual environment.

But when I start Airflow install inside the Python3 Virtual directory, the install fails with the below error:


  Running setup.py install for psutil ... error
    ERROR: Complete output from command /root/my_airflow/iged-airflow-dags/env/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-86bctfun/psutil/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-52q3vmn3/install-record.txt --single-version-externally-managed --compile --install-headers /root/my_airflow/iged-airflow-dags/env/include/site/python3.5/psutil:
    ERROR: /usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'python_requires'
      warnings.warn(msg)
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.5
    creating build/lib.linux-x86_64-3.5/psutil
    copying psutil/_psosx.py -> build/lib.linux-x86_64-3.5/psutil
    copying psutil/_compat.py -> build/lib.linux-x86_64-3.5/psutil
    copying psutil/_psaix.py -> build/lib.linux-x86_64-3.5/psutil
    copying psutil/_psposix.py -> build/lib.linux-x86_64-3.5/psutil
    copying psutil/_pslinux.py -> build/lib.linux-x86_64-3.5/psutil
    copying psutil/_pssunos.py -> build/lib.linux-x86_64-3.5/psutil
    copying psutil/_pswindows.py -> build/lib.linux-x86_64-3.5/psutil
    copying psutil/_psbsd.py -> build/lib.linux-x86_64-3.5/psutil
    copying psutil/__init__.py -> build/lib.linux-x86_64-3.5/psutil
    copying psutil/_common.py -> build/lib.linux-x86_64-3.5/psutil
    creating build/lib.linux-x86_64-3.5/psutil/tests
    copying psutil/tests/test_aix.py -> build/lib.linux-x86_64-3.5/psutil/tests
    copying psutil/tests/test_contracts.py -> build/lib.linux-x86_64-3.5/psutil/tests
    copying psutil/tests/test_posix.py -> build/lib.linux-x86_64-3.5/psutil/tests
    copying psutil/tests/test_osx.py -> build/lib.linux-x86_64-3.5/psutil/tests
    copying psutil/tests/test_connections.py -> build/lib.linux-x86_64-3.5/psutil/tests
    copying psutil/tests/test_process.py -> build/lib.linux-x86_64-3.5/psutil/tests
    copying psutil/tests/test_linux.py -> build/lib.linux-x86_64-3.5/psutil/tests
    copying psutil/tests/test_sunos.py -> build/lib.linux-x86_64-3.5/psutil/tests
    copying psutil/tests/test_windows.py -> build/lib.linux-x86_64-3.5/psutil/tests
    copying psutil/tests/test_unicode.py -> build/lib.linux-x86_64-3.5/psutil/tests
    copying psutil/tests/test_system.py -> build/lib.linux-x86_64-3.5/psutil/tests
    copying psutil/tests/__main__.py -> build/lib.linux-x86_64-3.5/psutil/tests
    copying psutil/tests/test_misc.py -> build/lib.linux-x86_64-3.5/psutil/tests
    copying psutil/tests/test_bsd.py -> build/lib.linux-x86_64-3.5/psutil/tests
    copying psutil/tests/__init__.py -> build/lib.linux-x86_64-3.5/psutil/tests
    copying psutil/tests/test_memory_leaks.py -> build/lib.linux-x86_64-3.5/psutil/tests
    copying psutil/tests/runner.py -> build/lib.linux-x86_64-3.5/psutil/tests
    running build_ext
    building 'psutil._psutil_linux' extension
    creating build/temp.linux-x86_64-3.5
    creating build/temp.linux-x86_64-3.5/psutil
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=563 -DPSUTIL_LINUX=1 -I/root/my_airflow/iged-airflow-dags/env/include -I/usr/include/python3.5m -c psutil/_psutil_common.c -o build/temp.linux-x86_64-3.5/psutil/_psutil_common.o
    psutil/_psutil_common.c:9:20: fatal error: Python.h: No such file or directory
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command "/root/my_airflow/iged-airflow-dags/env/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-86bctfun/psutil/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-52q3vmn3/install-record.txt --single-version-externally-managed --compile --install-headers /root/my_airflow/iged-airflow-dags/env/include/site/python3.5/psutil" failed with error code 1 in /tmp/pip-install-86bctfun/psutil/

Steps tried so far:

  1. Upgrading PIP to latest (19.1.1)

  2. Installing setup tools

  3. Updating missing pkgs (following a similar issue solution Can't install airflow using pip)

But Airflow install is failing inside the Virtual environment.

Any suggestions on how this can be fixed. Thanks in advance

  • Installing PythonX - dev packages did the trick. sudo apt-get install python-dev python3-dev – Vizag Jul 4 '19 at 21:36
0

Installing PythonX - dev packages did the trick. sudo apt-get install python-dev python3-dev Airflow has been installed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.