cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Exercise 16 - Can't load data using LOAD CSV

I'm using Neo4j Desktop for Windows.

I've attempted to import data from http://data.neo4j.com/intro-neo4j/actors.csv, but I get the error: Couldn't load the external resource at: http://data.neo4j.com/intro-neo4j/actors.csv

When I try to do it using the local filepath, I get the same error, even though I've placed the file in the correct import directory within my project.

I found an article that said to enable this setting: dbms.security.allow_csv_import_from_file_urls=true, but this doesn't appear to allow me to import from the filepath.

9 REPLIES 9

Can you share the cypher statement you've tried with us?

mojo2go
Graph Buddy

Hi! And welcome to the neo4j community.

Disclaimer: I am on a Mac. Shouldn't make a difference. If you are using Neo4j Desktop, your settings should be the same as mine. I ran the following command with no changes to the original settings and it produced a list of records:

LOAD CSV WITH HEADERS FROM 'http://data.neo4j.com/intro-neo4j/actors.csv' AS row
WITH row RETURN row

result:

row
{
  "birthYear": " 1946",
  "name": "Susan Sarandon",
  "id": "1"
}
{
  "birthYear": " 1967",
  "name": "Julia Roberts",
  "id": "2"
}
...

The extra permissions should not keep this from working.
You also need internet access, which you must have given that you posted this question.

I also downloaded the actors.csv file and placed it in my import directory and was able to fetch it with a small change in syntax:

LOAD CSV WITH HEADERS FROM 'file:///actors.csv' AS row
WITH row RETURN row

That also does not require extra permissions. Can you try that code and report back?

It looks like I needed to enable both settings in order to import from the import directory, which is now working perfectly. My guess on why I can't access the online resource is that my company has a firewall that's preventing me from connecting. I'll try it again on my home wifi and see if that works.

dbms.security.allow_csv_import_from_file_urls=true
dbms.directories.import=import

Thanks for your kind welcome! I'm happy to be a part of the community.

Hello Repalmervi,

After making these setting changes, it is saying that the password has been changed. and the old password is not authenticating. Any help please? I am new to Graph/Neo4j.

Hello @saumya003 ,
What are you attempting to connect to and with what? We need more context to help you.

Elaine

It could be a firewall issue. What does you import statement look like? We have never seen this problem before with this course.

Elaine

Hi Elaine!

Here's the code block I'm using
LOAD CSV WITH HEADERS
FROM 'http://data.neo4j.com/intro-neo4j/actors.csv'
AS line
RETURN line.id, line.name, line.birthYear
And here's the error that comes back (after a few seconds):

Can you download the CSV from a Web browser? Is it possible that you have a firewall that is preventing that location from being accessed?

If you can download the CSV from data.neo4j.com, you can also place the file in the import folder of your project and use the file:// syntax to read the data locally.

Elaine

Yup, I was able to download the file and stick it in the import directory. That worked! Still not sure what the issue was with the original query, but at least I can feed in my data. Thank you!