0

I have a docker image with python 2.7. I am trying to install airflow in the image, but during the pip installation of the airflow dependencies I am getting the below issues.

Dockerfile:-

FROM python:2.7-slim
...
...
# Install Airflow and Celery
COPY pip_airflow.txt /pip_airflow.txt
RUN pip install --no-cache-dir -r /pip_airflow.txt

Below is my pip_airflow.txt file.

apache-airflow[all]==1.10.0
celery[redis]>=4.2.1,<4.3.0
flower>=0.7.3,<1.0
kombu>=4.2.0,<5.0

Logs:- The failure is when the pip install for airflow is happening from the dockerfile.

Collecting pendulum==1.4.4 (from apache-airflow[all]==1.10.0->-r /pip_airflow.txt (line 1))
    Downloading https://files.pythonhosted.org/packages/85/a5/9fc15751f9725923b170ad37d6c61031fc9e941bafd5288ca6ee51233284/pendulum-1.4.4.tar.gz (74kB)
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'error'
    Complete output from command /usr/local/bin/python /usr/local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpnYnATX:
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 207, in <module>
        main()
      File "/usr/local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 197, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "/usr/local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 54, in get_requires_for_build_wheel
        return hook(config_settings)
      File "/tmp/pip-build-env-OXncUe/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 130, in get_requires_for_build_wheel
        return self._get_build_requires(config_settings, requirements=['wheel'])
      File "/tmp/pip-build-env-OXncUe/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 112, in _get_build_requires
        self.run_setup()
      File "/tmp/pip-build-env-OXncUe/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 126, in run_setup
        exec(compile(code, __file__, 'exec'), locals())
      File "setup.py", line 47, in <module>
        from build import *
      File "/usr/local/lib/python2.7/site-packages/pip/_vendor/pep517/build.py", line 7, in <module>
        from pip._vendor import pytoml
    ImportError: No module named pip._vendor
dks551
  • 1,113
  • 1
  • 15
  • 39
  • `pendulum` seems to be causing a [lot of chaos](https://stackoverflow.com/a/54416710/3679900) (although in your case, the [version is correct](https://github.com/apache/airflow/blob/v1-10-stable/setup.py#L327)) – y2k-shubham Feb 05 '19 at 19:47

1 Answers1

0

Update pip, e.g. pip install pip===19.0.2. In my case it worked.

ilja
  • 2,592
  • 2
  • 16
  • 23