An alternate approach – use the REST API:
Upload the file to ERPNext:
curl --silent --location --request POST 'https://erp.hogarparatodos.com.ec/api/method/upload_file' \
--header 'Authorization: token {{Key}}:{{Secret}}' \
--header 'Accept: application/json' \
--form 'file=@"/home/lopez/erpnext/cosas/planDeCuentas.csv"' \
--form 'is_private="1"'
Run the chart of accounts installer:
curl --silent --location --request POST 'https://erp.hogarparatodos.com.ec/api/method/erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.import_coa' \
--header 'Authorization: token {{Key}}:{{Secret}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"file_name": "/private/files/planDeCuentas.csv",
"company": "Hogar Para Todos"
}'