# Neo4j Docker - LOAD CSV - Couldn't load the external resource

**URL:** <https://community.neo4j.com/t/neo4j-docker-load-csv-couldnt-load-the-external-resource/59316>\
**Category:** Drivers & Stacks\
**Tags:** migrated\
**Created:** [February 14, 2020, 3:23pm UTC](https://community.neo4j.com/t/neo4j-docker-load-csv-couldnt-load-the-external-resource/59316 "2020-02-14T15:23:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![khan\_saqib](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/khan_saqib/32/5392_2.png) [@khan\_saqib](https://community.neo4j.com/u/khan_saqib)\
**Post date:** [February 14, 2020, 3:23pm UTC](https://community.neo4j.com/t/neo4j-docker-load-csv-couldnt-load-the-external-resource/59316/1 "2020-02-14T15:23:50Z")

</div>

Neo4j (with Docker) Version: 3.1.7  
Operating System: Xubuntu 16.04  
API: Python

Created Neo4j Docker with the following:  
sudo docker run  
--restart=unless-stopped  
--memory=9g  
--net=dnet01 --ip=1\*\*\* **1  
--volume=/production/data/neo4j/db:/var/lib/neo4j/data  
--volume=/production/analytics/Docker/neo4j/conf:/var/lib/neo4j/conf  
--volume=/etc/letsencrypt/neo4j:/var/lib/neo4j/certificates  
--volume=/production/analytics/Docker/neo4j/plugins:/var/lib/neo4j/plugins  
--volume=/production/analytics/Logs/neo4j:/var/lib/neo4j/logs  
--volume=/production/analytics/Temp:/var/lib/neo4j/import  
--env=NEO4J\_dbms\_memory\_pagecache\_size=8G  
--env=NEO4J\_dbms\_memory\_heap\_maxSize=8G  
--env=NEO4J\_dbms\_tx\_log\_rotation\_retention\_policy="2 days"  
--env=NEO4J\_dbms\_connectors\_default\_listen\_address=0.0.0.0  
--env=NEO4J\_dbms\_connector\_http\_enabled=true  
--ulimit=nofile=40000:40000  
--publish=7473:7473 --publish=7474:7474 --publish=7687:7687  
--env NEO4J\_AUTH=neo4j/**  
--name=pmirdk-neo4j  
-d neo4j:3.1.7

Placed a test\_file in location: /production/analytics/Temp/test-file.csv  
Then tried to run below code in python:  
test\_file="test-file.csv"  
file\_id="file:///"+str(test\_file)  
with neosession.begin\_transaction() as tx:  
tx.run("""LOAD CSV WITH HEADERS FROM {csv\_file} AS row  
MERGE (s:Test {Name: row.\_Name})  
SET s.id = row.\_id"""  
,{'csv\_file': file\_id}  
)  
tx.commit

When I run the above script I get the below error:  
**neo4j.v1.exceptions.CypherError: Couldn't load the external resource at: file:/production/analytics/Temp/test-file.csv**

My neo4j conf has the following:  
Below is commented out:  
##dbms.security.allow\_csv\_import\_from\_file\_urls=true

Below option in uncommented:  
dbms.directories.import=import

Not sure why the file in not being accessed: /production/analytics/Temp/test-file.csv

---

<div class="post-metadata">

**Author:** ![aegr82](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@aegr82](https://community.neo4j.com/u/aegr82)\
**Post date:** [October 24, 2022, 4:39am UTC](https://community.neo4j.com/t/neo4j-docker-load-csv-couldnt-load-the-external-resource/59316/2 "2022-10-24T04:39:27Z")

</div>

Using docker, I defined the import volume as:

-v $HOME/neo4j/import:/var/lib/neo4j/import

Then, I copied the files to :/import... i.e.

sudo docker cp myfile.csv neo4j:/import

That works for me.
