Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cypher Neo4j Couldn't load the external resource

Tags:

In a Windows environment, I'm trying to load a .csv file with statement:

LOAD CSV WITH HEADERS FROM "file:///E:/Neo4j/customers.csv" AS row 

It seems not to work properly and returns: Couldn't load the external resource at:

file:/E:/Neo4j/Customers.csv Neo.TransientError.Statement.ExternalResourceFailure

What am I doing wrong? thanks in advance

like image 854
user13568 Avatar asked Feb 08 '15 20:02

user13568


1 Answers

I was getting this error on Community Edition 3.0.1 on Mac OS X 10.10 It appears that the LOAD CSV file:/// looks for files in a predefined directory. One would think that in the argument that one would give the Cypher statement the full path but that is not the case.

The file:/// - for my situation" meant that neo4j would append the given argument you gave to one that was already predefined and then go look for that combined path The file:/// pre-defined directory directory did not exist entirely /Users/User/Documents/Neo4j/default.graphdb/import, in my computers directory structure I was missing the "/import" folder, which was not created at install

To fix on my system, I created an "import" directory, put the file to be read in that directory. I executed the Cypher load statement I ONLY put the name of the file to be read in the file argument i.e.

LOAD CSV file:///data.csv 

this worked for me.

like image 91
Richard Avila Avatar answered Sep 30 '22 18:09

Richard Avila