1

I just install neo4j 3.2.3 on my windows notebook and I try to load csv file.

LOAD CSV WITH HEADERS FROM 'file:///test.csv' AS line
WITH toUpper(line.TEST_NAME) AS TEST_NAME
CREATE(TEST);

I got the following error:

Neo.ClientError.Statement.ExternalResourceFailed: Couldn't load the external resource at: file:/C:/Users/*****/Documents/Neo4j/default.graphdb/import/test.csv

I cannot locate the neo4j.conf or propriety files in the default.graphdb directories.

can someone help?


I'm on windows 10 neo4j 3.2.3. I can load from url. but with the same file format, I failed to load from local.

LOAD CSV FROM "https://gist.githubusercontent.com/jexp/d788e117129c3730a042/raw/a147631215456d86a77edc7ec08c128b9ef05e3b/people_leading_empty.csv"
AS line
WITH line LIMIT 4
RETURN line

successful

with the same file save as .../Neo4j/default.graphdb/import/test1.csv

LOAD CSV WITH HEADERS FROM "file:///test1.csv" AS line 
WITH line LIMIT 4 
RETURN line

I got error:

Neo.ClientError.Statement.ExternalResourceFailed: Couldn't load the external resource at: file:/C:/Users/....../Documents/Neo4j/default.graphdb/import/test.csv

From the error message, it can locate the file. But cannot perform the LOAD from local.

McGrady
  • 10,869
  • 13
  • 47
  • 69
jass
  • 11
  • 1
  • 3
  • Possible duplicate of [Cypher Neo4j Couldn't load the external resource](https://stackoverflow.com/questions/28398778/cypher-neo4j-couldnt-load-the-external-resource) – Alex Aug 04 '17 at 09:45
  • I can load from url, but cannot load from local with the same file. – jass Aug 04 '17 at 10:54

2 Answers2

0

I cannot locate the neo4j.conf or propriety files in the default.graphdb directories.

According to the Neo4j docs, the neo4j.conf file is located in the directory <neo4j-home>\conf\neo4j.conf for zip packages and %APPDATA%\Neo4j Community Edition\neo4j.conf for desktop installation.

You should locate the configuration file and set the following line.

dbms.security.allow_csv_import_from_file_urls=true
Bruno Peres
  • 15,845
  • 5
  • 53
  • 89
0

The LOAD CSV operation in Neo4j can only load the UTF-8 format files, try to change the import file's format to UTF-8(save the .csv file as .csv(utf-8) type).