py2neo AddressError When Connecting to neo4j in Docker
I had a similar error while using a virtual environment using PyCharm.  In my case, I was using an upgraded version of neo4j-driver in my virtual environment compared to my host environment.  I downgraded neo4j-driver from 1.7 to 1.6.2.

Make sure you have neo4j-driver installed in general.