title: ImportError: No module named 'email.mime'; email is not a package
body: <p>When running the below code, I keep getting the error:</p>
  
  <pre><code>ImportError: No module named 'email.mime'; email is not a package
  </code></pre>
  
  <p>So I run: </p>
  
  <pre><code>pip install email
  </code></pre>
  
  <p>And get the following error: </p>
  
  <pre><code>ImportError: No module named 'cStringIO'...
  Command "python setup.py egg_info" failed with error code 1
  </code></pre>
  
  <p>The internet has told me to run:</p>
  
  <pre><code>pip install --upgrade pip
  </code></pre>
  
  <p>To solve this problem, which I've done many times now. I don't know what else I can do. </p>
  
  <p>Python version: Python 3.3.5 | Anaconda 2.3.0 (x86_64)</p>
  
  <pre><code>import smtplib,email,email.encoders,email.mime.text,email.mime.base
  
  smtpserver = 'email@site.com'
  to = ['address@gmail.com']
  fromAddr = 'email@site.com'
  subject = "testing email attachments"
  
  # create html email
  html = '&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" '
  html +='"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;'
  html +='&lt;body style="font-size:12px;font-family:Verdana"&gt;&lt;p&gt;...&lt;/p&gt;'
  html += "&lt;/body&gt;&lt;/html&gt;"
  emailMsg = email.MIMEMultipart.MIMEMultipart('text/csv')
  emailMsg['Subject'] = subject
  emailMsg['From'] = fromAddr
  emailMsg['To'] = ', '.join(to)
  emailMsg['Cc'] = ", ".join(cc)
  emailMsg.attach(email.mime.text.MIMEText(html,'html'))
  
  # now attach the file
  fileMsg = email.mime.base.MIMEBase('text/csv')
  fileMsg.set_payload(file('rsvps.csv').read())
  email.encoders.encode_base64(fileMsg)
  fileMsg.add_header('Content-Disposition','attachment;filename=rsvps.csv')
  emailMsg.attach(fileMsg)
  
  # send email
  server = smtplib.SMTP(smtpserver)
  server.sendmail(fromAddr,to,emailMsg.as_string())
  server.quit()
  </code></pre>