title: How to connect Cassandra in Jupyter notebook In Anaconda with Python?
body: <p>I am trying to use Cassandra on my computer. What I have done:</p>
  <pre><code>! pip install cassandra-driver
  </code></pre>
  <p>Successfully installed cassandra-driver-3.24.0 geomet-0.2.1.post1</p>
  <pre><code>import Cassandra
  </code></pre>
  <p>Create a connection to the database</p>
  <p>Then the connection to the database</p>
  <pre><code>from cassandra.cluster import Cluster
  try: 
      cluster = Cluster(['127.0.0.1']) 
      session = cluster.connect()
  except Exception as e:
      print(e)
  </code></pre>
  <p>There is an error:</p>
  <pre><code>('Unable to connect to any servers', {'127.0.0.1:9042': ConnectionRefusedError(10061, &quot;Tried connecting to [('127.0.0.1', 9042)]. Last error: No connection could be made because the target machine actively refused it&quot;)})
  </code></pre>
  <p>I am wondering whether there is a configuration problem, then I check below:
  The user variable for Java_Hone as below:
  <a href="https://i.stack.imgur.com/UsrJI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UsrJI.png" alt="enter image description here" /></a></p>
  <p>Cassandra is installed here:<br />
  C:\Users\xx\anaconda3\Lib\site-packages<br />
  There are two packages under site-packages:<br />
  <a href="https://i.stack.imgur.com/AT6zX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AT6zX.png" alt="enter image description here" /></a></p>
  <p>I have checked a lot of answers, but couldn't find the solution. I am not familiar with the configuration. Can anybody help with it?
  Thanks.</p>