How to connect Python and neo4j?
<p>I am new to <code>neo4j</code> and want it to connect with Python. I am using <code>neo4j</code> version 3.0.3 and following <a href="https://github.com/neo4j/neo4j-python-driver" rel="nofollow noreferrer">this tutorial</a>.</p>

<p>I put the code below in my Python file, I have changed the password, since my password is <code>root</code>:</p>

<pre><code>from neo4j.v1 import GraphDatabase, basic_auth
driver = GraphDatabase.driver("bolt://localhost", auth=basic_auth(user = "neo4j", password = "root"))
session = driver.session()
session.run("CREATE (a:Person {name:'Bob'})")
result = session.run("MATCH (a:Person) RETURN a.name AS name")
for record in result:
    print(record["name"])
session.close()
</code></pre>

<p>But on running it, I am getting following errors:</p>

<pre><code>Traceback (most recent call last):
  File "D:/Work/MySQL_neo4j_Importer/dumping_ingredients.py", line 3, in &lt;module&gt;
    session = driver.session()
  File "C:\Python27\lib\site-packages\neo4j\v1\session.py", line 148, in session
    session = Session(self)
  File "C:\Python27\lib\site-packages\neo4j\v1\session.py", line 461, in __init__
    self.connection = connect(driver.host, driver.port, driver.ssl_context, **driver.config)
  File "C:\Python27\lib\site-packages\neo4j\v1\connection.py", line 403, in connect
    s = create_connection((host, port))
  File "C:\Python27\lib\socket.py", line 557, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
socket.gaierror: [Errno 11004] getaddrinfo failed
</code></pre>

<p>I have also tried <a href="https://stackoverflow.com/questions/37697695/neo4j-unable-to-connect-to-graph-database-server">this</a> StackOverFlow answer as well, but, the result remains same.</p>