title: Connecting Python/pandas to Redshift when SSL is required
body: <p>My company recently changed our Redshift cluster and now they require an SSL connection. In the past I've connected Python/pandas to Redshift via the method I've detailed here: <a href="http://measureallthethin.gs/blog/connect-python-and-pandas-to-redshift/" rel="noreferrer">http://measureallthethin.gs/blog/connect-python-and-pandas-to-redshift/</a></p>
  
  <p>From the SQLAlchemy documentation, looks like all I need to do is add <code>connect_args={'sslmode':'require'}</code> to the <code>create_engine()</code> call, as this thread pointed out: <a href="https://stackoverflow.com/questions/25095591/how-do-i-connect-to-postgresql-using-ssl-from-sqlachemypg8000">How do I connect to Postgresql using SSL from SqlAchemy+pg8000?</a></p>
  
  <p>However, I now get this error:</p>
  
  <blockquote>
    <p>OperationalError: (psycopg2.OperationalError) sslmode value "require" invalid when SSL support is not compiled in</p>
  </blockquote>
  
  <p>I use the Anaconda distribution for a number of packages, and found I needed to update my psycopg2 package per these instructions: <a href="https://groups.google.com/a/continuum.io/d/msg/conda/Fqv93VKQXAc/mHqfNK8xZWsJ" rel="noreferrer">https://groups.google.com/a/continuum.io/d/msg/conda/Fqv93VKQXAc/mHqfNK8xZWsJ</a></p>
  
  <p>However, even after updating psycopg2 I'm still getting the same error and am at a loss at this point on how to further debug. I'd like to figure this out so I can get our Redshift data directly into pandas.</p>