Saving data back to neo4j using python

I'm trying to save the PageRank data back to Neo4j, as the steps in https://neo4j.com/blog/neo4j-3-0-apache-spark-connector/ but an error occured.

My code is as follow:

import org.neo4j.spark._ 
import org.apache.spark.graphx._
import org.apache.spark.graphx.lib._
val neo = Neo4j(sc)
val g = Neo4jGraph.loadGraph(sc, label1="node", relTypes=Seq("connect"),  label2="node")
val g2 = PageRank.run(g, numIter = 9)
val v = g2.vertices.take(9)
Neo4jGraph.saveGraph(sc, g2,"rank")

The error: org.neo4j.driver.exceptions.ClientException: Writing in read access mode not allowed. Attempted write to internal graph 0 (neo4j)

Note: everything is run well until the last line of code.