title: Twilio Python Module Errors After Compiling
body: <p>I have written a simple program that opens a csv file and text all the numbers in it. I am using Twilio (<a href="https://www.twilio.com/docs/python/install" rel="nofollow">twilio-python</a>) as a service provider. My code works fine as a python script. However, when I compile the script (using py2exe), the exe file errors. This is the error I receive from the log file.... </p>
  
  <pre><code> Traceback (most recent call last):
   File "sms.py", line 39, in &lt;module&gt;
   File "twilio\rest\resources\messages.pyc", line 112, in create
   File "twilio\rest\resources\base.pyc", line 352, in create_instance
   File "twilio\rest\resources\base.pyc", line 204, in request
   File "twilio\rest\resources\base.pyc", line 129, in make_twilio_request
   File "twilio\rest\resources\base.pyc", line 101, in make_request
   File "httplib2\__init__.pyc", line 1570, in request
   File "httplib2\__init__.pyc", line 1317, in _request
   File "httplib2\__init__.pyc", line 1252, in _conn_request
   File "httplib2\__init__.pyc", line 1021, in connect
   File "httplib2\__init__.pyc", line 80, in _ssl_wrap_socket
   File "ssl.pyc", line 387, in wrap_socket
   File "ssl.pyc", line 141, in __init__
   ssl.SSLError: [Errno 185090050] _ssl.c:340: error:0B084002:x509 certificate               
   routines:X509_load_cert_crl_file:system lib
  </code></pre>
  
  <p>I don't recieve this error when i am using the un-compiled code  (below)</p>
  
  <pre><code>  import sys #2 params --- /path/to/contact/file    --- up to 160 char msg
    import csv
    import time
  
    from twilio.rest import TwilioRestClient 
    ACCOUNT_SID = "**************************" 
    AUTH_TOKEN  = "**************************" 
    client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN) 
  
    sys.argv.pop(0)
    contactFile = sys.argv[0]
    sys.argv.pop(0)
    msg = (' ').join(sys.argv)
  
    print contactFile
    print " "
    print msg
  
    info = []
    with open(contactFile,'rb') as csvfile:
     reader = csv.reader(csvfile, delimiter=',', quotechar='|')
          for row in reader:
          info.append(row)
  
    contactCount = len(info)-1
  
    if contactCount &gt; 0:
       #remove first item from list because its not a value that is needed....
       info.pop(0)
  
     for i in info:
         print " "
         contactName = i[0]
         phoneNumber = i[1]
         print "Texting " + contactName + "... \n"
         client.messages.create(
         to=phoneNumber, 
         from_="+14782856136",
         body=msg   
         )
         time.sleep(1.5)
      else:
       print("SMSify Error \n The contact file doesn't have any contacts in it.")
  </code></pre>
  
  <p>Any thoughts on what is going on??</p>
  
  <p>EDIT:</p>
  
  <p>Here is my setup.py file</p>
  
  <pre><code>from distutils.core import setup
  import py2exe, sys, os
  sys.argv.append('py2exe')
  Mydata_files = [('cacert.pem', ['C:\\Python27\\Lib\\site-      
  packages\\twilio\\conf\\cacert.pem'])]
  
  setup(
     console=['sms.py'],
     data_files = Mydata_files,
     options={
                "py2exe":{
                      "bundle_files": 1,
                      "compressed": True
                  }
           }
   )
  </code></pre>