title: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-jsegcbha/mysqlclient/
body: <p>MacOS High Sierra</p>
  
  <p>Python 3.6.3</p>
  
  <p>docker-compose.yml</p>
  
  <pre><code>version: '3'
  services:
    celery:
      container_name: "cache_bot"
      build:
        context: .
        dockerfile: docker/celery/Dockerfile
      command: "celery -A cache_bot.app worker --loglevel=info"
      volumes:
        - ./src:/www
  </code></pre>
  
  <p>Dockerfile</p>
  
  <pre><code>FROM python:3.6-alpine
  
  RUN apk --update add --no-cache bash gcc libc-dev unixodbc-dev python3-dev
  
  ADD ./src /www
  ADD ./requirements.txt /home
  
  WORKDIR /www
  
  RUN pip install -r /home/requirements.txt
  </code></pre>
  
  <p>requirements.txt</p>
  
  <pre><code>mysqlclient==1.3.12
  ...
  </code></pre>
  
  <p>When I run command 'docker-compose build' I get the error:</p>
  
  <p>Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-jsegcbha/mysqlclient/</p>
  
  <p>ERROR: Service 'celery' failed to build: The command '/bin/sh -c pip install -r /home/requirements.txt' returned a non-zero code: 1</p>
  
  <p>Full traceback:</p>
  
  <p>Collecting mysqlclient==1.3.12 (from -r /home/requirements.txt (line 8))</p>
  
  <p>Downloading <a href="https://files.pythonhosted.org/packages/6f/86/bad31f1c1bb0cc99e88ca2adb7cb5c71f7a6540c1bb001480513de76a931/mysqlclient-1.3.12.tar.gz" rel="nofollow noreferrer">https://files.pythonhosted.org/packages/6f/86/bad31f1c1bb0cc99e88ca2adb7cb5c71f7a6540c1bb001480513de76a931/mysqlclient-1.3.12.tar.gz</a> (89kB)</p>
  
  <p>Complete output from command python setup.py egg_info:</p>
  
  <p>/bin/sh: mysql_config: not found</p>
  
  <p>Traceback (most recent call last):</p>
  
  <p>File "/tmp/pip-install-jsegcbha/mysqlclient/setup.py", line 17, in 
          metadata, options = get_config()</p>
  
  <p>File "/tmp/pip-install-jsegcbha/mysqlclient/setup_posix.py", line 44, in get_config libs = mysql_config("libs_r")</p>
  
  <p>File "/tmp/pip-install-jsegcbha/mysqlclient/setup_posix.py", line 26, in mysql_config</p>
  
  <p>raise EnvironmentError("%s not found" % (mysql_config.path,))</p>
  
  <p>OSError: mysql_config not found</p>
  
  <p>Actually, mysql_config is by path /usr/local/bin and this path is set up in $PATH</p>
  
  <p>I've tried - RUN pip install --upgrade setuptools - in my Dockerfile. It did not help.</p>
  
  <p>ENV PATH /usr/local/bin:$PATH in Dockerfile did not help as well.</p>
  
  <p>Thanks a lot!!!!!!!!!!!!!</p>