title: How to install Python 3.7 packages to Docker?
body: <p>I am very new to docker. I am building a docker for the first time. I have created a Dockerfile and need to add python packages (specifically to emails). However I am getting an error while building the docker file.</p>
  
  <pre><code>FROM alpine
  MAINTAINER &lt;abc@gmail.com&gt;
  FROM python:3.7
  
  RUN pip install --upgrade pip &amp;&amp; \
      pip install --no-cache-dir nibabel pydicom matplotlib pillow &amp;&amp; \
      pip install --no-cache-dir med2image
  
  RUN pip install pandas xlsxwriter numpy boto boto3 botocore
  RUN pip install oauth2client urllib3 httplib2 email mimetypes apiclient
  RUN pip install snowflake.connector
  
  ENV APP_HOME /Users/username/
  ENV TZ=America/Los_Angeles
  
  RUN mkdir -p $APP_HOME/code/
  WORKDIR $APP_HOME
  ENTRYPOINT [ "python"]
  </code></pre>
  
  <p>I am getting the following error:</p>
  
  <pre><code>Downloading https://files.pythonhosted.org/packages/71/e7/816030d3b0426c130040bd068be62b9213357ed02896f5d9badcf46d1b5f/email-4.0.2.tar.gz (1.2MB)
      Complete output from command python setup.py egg_info:
      Traceback (most recent call last):
        File "&lt;string&gt;", line 1, in &lt;module&gt;
        File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 18, in &lt;module&gt;
          import setuptools.version
        File "/usr/local/lib/python3.7/site-packages/setuptools/version.py", line 1, in &lt;module&gt;
          import pkg_resources
        File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 36, in &lt;module&gt;
          import email.parser
        File "/tmp/pip-install-1m3cdjov/email/email/parser.py", line 10, in &lt;module&gt;
          from cStringIO import StringIO
      ModuleNotFoundError: No module named 'cStringIO'
  
      ----------------------------------------
  Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-1m3cdjov/email/
  The command '/bin/sh -c pip install oauth2client urllib3 httplib2 email mimetypes apiclient' returned a non-zero code: 1
  </code></pre>
  
  <p>I have installed these packages successfully in Pycharm and have no issues with it. I am not sure how to fix this in docker. Any help would be appreciated.</p>