Installing Python 3 Docker Ubuntu error command 'x86_64-linux-gnu-gcc

I’m trying to create a dockerfile that uses Python 3.

FROM ubuntu:14.04
RUN apt-get update
RUN apt-get install -y python3 python3-dev python-pip
RUN apt-get install -y libxml2-dev libxslt1-dev libpq-dev libjpeg-dev libfreetype6-dev zlib1g-dev
RUN cd /var/projects/apps && pip install -r requirements.txt

I get the error fatal error: Python.h: No such file or directory when trying to install pillow in my requirements, why and I’m I installing python 3 correctly?

  • can't restart docker after resetting the docker socker using docker -H tcp://0.0.0.0:2375
  • How to wait for an etcd variable is set before starting the unit/service
  • Announcing your app from within a container (docker)
  • Dockerfile: Permission denied when trying to install ruby-build
  • How Docker and Ansible fit together to implement Continuos Delivery/Continuous Deployment
  • Restore mongodb dump from a folder using Docker in ubuntu
  • error:
    
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    
    ----------------------------------------
    Cleaning up...
    Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-C7CMih-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/pillow
    Storing debug log for failure in /root/.pip/pip.log
    INFO[0102] The command [/bin/sh -c cd /var/projects/app && pip install -r requirements.txt] returned a non-zero code: 1
    

  • Where to find my discourse output?
  • Can I mount host directory contents to container directory?
  • Adding a dir to root in docker still wont allow git access
  • How to set subnet for Docker 1.9 overflow network?
  • Cannot see Ipython notebook interface on a browser using Docker Kitematic
  • Service 'odoo' failed to build from docker
  • One Solution collect form web for “Installing Python 3 Docker Ubuntu error command 'x86_64-linux-gnu-gcc”

    You should install python3-pip in your Dockerfile and then run pip3 install -r requirements.txt

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.