Hallo,
ich bin Neuling in Sachen py2neo und verwende ein Python Script, welches für Linux geschrieben war. Ein Script 'fügt' etwas in Neo4j ein und das
andere Script 'empfängt' etwas von Neo4j. Nun verwende ich die Scripte unter Windows. Ich weiß, dass sich die Pfade ändern. Die habe ich geändert, aber ich funktioniert trotzdem nicht alles.
Gibt es noch etwas anderes zu beachten von Linux zu Windows bei Pythonskripte bzw bei der Arbeit mit py2neo ?
p2neo Unterschied Linux Windows
Das ist die Fehlermeldung:
- file:///c:\Users\nounh\Desktop\170612_Graph_contiio\170801 data\20170801__1641_NODE_CustomerModule.csv
Traceback (most recent call last):
File "Desktop\170612_Graph_contiio\bin\pythontest\170914_pyneo4j-db-transactions.py", line 162, in <module>
cypher_csv_read_folder("c:\\")
File "Desktop\170612_Graph_contiio\bin\pythontest\170914_pyneo4j-db-transactions.py", line 111, in cypher_csv_read_folder
cypher_csv_read_file(filepath)
File "Desktop\170612_Graph_contiio\bin\pythontest\170914_pyneo4j-db-transactions.py", line 66, in cypher_csv_read_file
graph.run(message)
File "C:\Users\nounh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py2neo\database\__init__.py", line 731, in run
return self.begin(autocommit=True).run(statement, parameters, **kwparameters)
File "C:\Users\nounh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py2neo\database\__init__.py", line 1277, in run
self.finish()
File "C:\Users\nounh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py2neo\database\__init__.py", line 1296, in finish
self._sync()
File "C:\Users\nounh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py2neo\database\__init__.py", line 1286, in _sync
connection.fetch()
File "C:\Users\nounh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py2neo\packages\neo4j\v1\bolt.py", line 344, in fetch
handler(*fields)
File "C:\Users\nounh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py2neo\database\__init__.py", line 961, in on_failure
raise GraphError.hydrate(metadata)
py2neo.database.status.CypherSyntaxError: Invalid input 's': expected four hexadecimal digits specifying a unicode character (line 1, column 63 (offset: 62))
"USING PERIODIC COMMIT LOAD CSV WITH HEADERS FROM 'file:///c:\Users\nounh\Desktop\170612_Graph_contiio\170801 data\20170801__1641_NODE_CustomerModule.csv' AS row CREATE (:CustomerModule {DoorsURL: row.URL, Name: row.name, fullName: row.fullname, projectName: row.projectname});"
^
- file:///c:\Users\nounh\Desktop\170612_Graph_contiio\170801 data\20170801__1641_NODE_CustomerModule.csv
Traceback (most recent call last):
File "Desktop\170612_Graph_contiio\bin\pythontest\170914_pyneo4j-db-transactions.py", line 162, in <module>
cypher_csv_read_folder("c:\\")
File "Desktop\170612_Graph_contiio\bin\pythontest\170914_pyneo4j-db-transactions.py", line 111, in cypher_csv_read_folder
cypher_csv_read_file(filepath)
File "Desktop\170612_Graph_contiio\bin\pythontest\170914_pyneo4j-db-transactions.py", line 66, in cypher_csv_read_file
graph.run(message)
File "C:\Users\nounh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py2neo\database\__init__.py", line 731, in run
return self.begin(autocommit=True).run(statement, parameters, **kwparameters)
File "C:\Users\nounh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py2neo\database\__init__.py", line 1277, in run
self.finish()
File "C:\Users\nounh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py2neo\database\__init__.py", line 1296, in finish
self._sync()
File "C:\Users\nounh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py2neo\database\__init__.py", line 1286, in _sync
connection.fetch()
File "C:\Users\nounh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py2neo\packages\neo4j\v1\bolt.py", line 344, in fetch
handler(*fields)
File "C:\Users\nounh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py2neo\database\__init__.py", line 961, in on_failure
raise GraphError.hydrate(metadata)
py2neo.database.status.CypherSyntaxError: Invalid input 's': expected four hexadecimal digits specifying a unicode character (line 1, column 63 (offset: 62))
"USING PERIODIC COMMIT LOAD CSV WITH HEADERS FROM 'file:///c:\Users\nounh\Desktop\170612_Graph_contiio\170801 data\20170801__1641_NODE_CustomerModule.csv' AS row CREATE (:CustomerModule {DoorsURL: row.URL, Name: row.name, fullName: row.fullname, projectName: row.projectname});"
^
ich habe immer zu Backslashes hinterinander \\ gemacht. Bei normalen Scripten unter Windows konnte so jede Pfad bisher öffnen.
Ich habe nun einen normalen Slash dafür verwendet und er gibt nun wieder eine Fehlermeldung raus:
Traceback (most recent call last):
File "Desktop\170612_Graph_contiio\bin\pythontest\170914_pyneo4j-db-transactions.py", line 162, in <module>
cypher_csv_read_folder("c:\\")
File "Desktop\170612_Graph_contiio\bin\pythontest\170914_pyneo4j-db-transactions.py", line 111, in cypher_csv_read_folder
cypher_csv_read_file(filepath)
File "Desktop\170612_Graph_contiio\bin\pythontest\170914_pyneo4j-db-transactions.py", line 66, in cypher_csv_read_file
graph.run(message)
File "C:\Users\nounh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py2neo\database\__init__.py", line 731, in run
return self.begin(autocommit=True).run(statement, parameters, **kwparameters)
File "C:\Users\nounh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py2neo\database\__init__.py", line 1277, in run
self.finish()
File "C:\Users\nounh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py2neo\database\__init__.py", line 1296, in finish
self._sync()
File "C:\Users\nounh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py2neo\database\__init__.py", line 1286, in _sync
connection.fetch()
File "C:\Users\nounh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py2neo\packages\neo4j\v1\bolt.py", line 344, in fetch
handler(*fields)
File "C:\Users\nounh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py2neo\database\__init__.py", line 961, in on_failure
raise GraphError.hydrate(metadata)
py2neo.database.status.CypherSyntaxError: Invalid input 's': expected four hexadecimal digits specifying a unicode character (line 1, column 63 (offset: 62))
"USING PERIODIC COMMIT LOAD CSV WITH HEADERS FROM 'file:///c:\Users\nounh\Desktop\170612_Graph_contiio\170801 data\20170801__1641_NODE_CustomerModule.csv' AS row CREATE (:CustomerModule {DoorsURL: row.URL, Name: row.name, fullName: row.fullname, projectName: row.projectname});"
Ich habe nun einen normalen Slash dafür verwendet und er gibt nun wieder eine Fehlermeldung raus:
Traceback (most recent call last):
File "Desktop\170612_Graph_contiio\bin\pythontest\170914_pyneo4j-db-transactions.py", line 162, in <module>
cypher_csv_read_folder("c:\\")
File "Desktop\170612_Graph_contiio\bin\pythontest\170914_pyneo4j-db-transactions.py", line 111, in cypher_csv_read_folder
cypher_csv_read_file(filepath)
File "Desktop\170612_Graph_contiio\bin\pythontest\170914_pyneo4j-db-transactions.py", line 66, in cypher_csv_read_file
graph.run(message)
File "C:\Users\nounh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py2neo\database\__init__.py", line 731, in run
return self.begin(autocommit=True).run(statement, parameters, **kwparameters)
File "C:\Users\nounh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py2neo\database\__init__.py", line 1277, in run
self.finish()
File "C:\Users\nounh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py2neo\database\__init__.py", line 1296, in finish
self._sync()
File "C:\Users\nounh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py2neo\database\__init__.py", line 1286, in _sync
connection.fetch()
File "C:\Users\nounh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py2neo\packages\neo4j\v1\bolt.py", line 344, in fetch
handler(*fields)
File "C:\Users\nounh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py2neo\database\__init__.py", line 961, in on_failure
raise GraphError.hydrate(metadata)
py2neo.database.status.CypherSyntaxError: Invalid input 's': expected four hexadecimal digits specifying a unicode character (line 1, column 63 (offset: 62))
"USING PERIODIC COMMIT LOAD CSV WITH HEADERS FROM 'file:///c:\Users\nounh\Desktop\170612_Graph_contiio\170801 data\20170801__1641_NODE_CustomerModule.csv' AS row CREATE (:CustomerModule {DoorsURL: row.URL, Name: row.name, fullName: row.fullname, projectName: row.projectname});"
Hast du nicht. Ich sehe doch die Backslashes in der Fehlerausgabe. Und \Users ist etwas, das irgendein Parser da in ein unicode-Literal umwandeln will, und dabei jaemmerlich scheitert. Also sind da noch irgendwo backslashes.
Die Backslashes wurden alle ersetzt. Was im Fehler angezeigt wird, ist ein Pfad wie Windows ihn immer mit Backslashes anzeigt.
Wie gesagt im skript sind keine Backslashes mehr. Ich weiß leider auch noch nicht woran es nun liegt.
Wie gesagt im skript sind keine Backslashes mehr. Ich weiß leider auch noch nicht woran es nun liegt.
Ich bin bezüglich deiner Erklärung skeptisch. Mir passen der Fehler und der Pfad zu gut zusammen, um nicht zusammen zu gehören.
Und wenn man das andere Problem sieht, wird einem schummerig. os.system und sudo - das ist ziemlich ahungslos.
Was ist denn das für ein Skript? Gehört das zu py2neo, oder ist das aus irgendwelchen Untiefen des Internets? Und wie sieht das aus?
Und wenn man das andere Problem sieht, wird einem schummerig. os.system und sudo - das ist ziemlich ahungslos.
Was ist denn das für ein Skript? Gehört das zu py2neo, oder ist das aus irgendwelchen Untiefen des Internets? Und wie sieht das aus?