macoscsvneo4jloadneo4j-desktop

Neo.ClientError.Statement.ExternalResourceFailed on Mac


I have a CSV file I generate through code. I want to import the generated CSV file into neo4j using the following cypher query.

 LOAD CSV WITH HEADERS FROM 'file:////Users/{user}/Desktop/neo4j-importer/tmp/temp_data.csv'

I have changed the following config varables

Commenting out dbms.directories.import=import. And set dbms.security.allow_csv_import_from_file_urls=true

Problem is I get thrown the following error:

Neo.ClientError.Statement.ExternalResourceFailed: 
Couldn't load the external resource at: 
file:/Users/{user}/Library/Application%20Support/Neo4j%20Desktop/Application/neo4jDatabases/database-c517b267-220d-4b7a-be26-813d5b64a51a/installation-3.5.3/import/Users/{user}/Desktop/neo4j-importer/tmp/temp_data.csv

I mean it is partly right just not the /Users/{user}/Library/Application%20Support/Neo4j%20Desktop/Application/neo4jDatabases/database-c517b267-220d-4b7a-be26-813d5b64a51a/installation-3.5.3/import/ bit... Any suggestions on how to fix this weird file pathing problem?


Solution

  • Try changing the config setting to point to the directory with your imports:

    dbms.directories.import=/Users/{user}/Desktop/neo4j-importer/tmp
    

    and then changing the Cypher query to just specify the CSV file:

    LOAD CSV WITH HEADERS FROM 'file:///temp_data.csv'
    ...