title: I can't connect to Cassandra with DataStax Python driver
body: <p>I'm having trouble connecting to Cassandra (running on an EC2 node) <strong>locally</strong> with DataStax Python driver for Cassandra: (similar to <a href="https://stackoverflow.com/questions/30608548/unable-to-connect-to-cassandra-remotely-using-datastax-python-driver">this question</a>)</p>
  
  <pre><code>from cassandra.cluster import Cluster
  cluster = Cluster(['127.0.0.1'], port=9042)
  cluster.connect()
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>cassandra.cluster.NoHostAvailable: ('Unable to connect to any servers', {'127.0.0.1': OperationTimedOut('errors=Timed out creating connection (5 seconds), last_host=None',)})
  </code></pre>
  
  <p>The same if i run:</p>
  
  <pre><code>cluster = Cluster(['127.0.0.1'], port=9160)
  cluster.connect()
  </code></pre>
  
  <p>The service seems to listen in the correct port:</p>
  
  <p>netstat -nltp | grep 9042
  (No info could be read for "-p": geteuid()=1000 but you should be root.)
  tcp6       0      0 127.0.0.1:9042          :::*                    LISTEN      -</p>
  
  <p>Also the command <code>cqlsh 127.0.0.1 9042</code> work perfectly.</p>
  
  <p>I have the default settings on file <code>cassandra.yaml</code>:</p>
  
  <pre><code>start_native_transport: true
  native_transport_port: 9042
  rpc_address: localhost
  rpc_port: 9160
  </code></pre>
  
  <p>I also tried to change the rpc_address with the PRIVATE_IP of my ec2 instance but nothing changed.</p>
  
  <p>I don't use PyCharm, I use the interactive console of python on my instance.</p>
  
  <p>Can somebody explain to me what I'm doing wrong?</p>
  
  <p>Thanks</p>