0

Getting the following error:

ImportError: cannot import name FileImport

Code, taken directly from Carto documentation:

from cartodb import CartoDBAPIKey, CartoDBException, FileImport

API_KEY ='MY_API_KEY'
cartodb_domain = 'MY_DOMAIN'
cl = CartoDBAPIKey(API_KEY, cartodb_domain)

# Import csv file, set privacy as 'link' and create a default viz
fi = FileImport("ground_temperature_KG.csv", cl, create_vis='true', privacy='link')
fi.run()

The cartodb-python client that I installed seems to include everything. CartoDBAPIKey and CartoDBException are located in cartodb.py and FileImport is located in imports.py. But import is only recognizing the first two modules and not the last...

enter image description here

2

What version of the python SDK are you using? I would recommend using the content of the branch 1.0.0 of the carto-python repo.

Here you can find an example to import a file to CARTO using the CARTO Python SDK. If your account does not belong to an org, omit that parameter from the auth authentication part. Take into account that the branch 1.0.0 of the Python SQK is still a work in progress.

  • A few of us have been working on this so I forget where we were at originally, but we've since got it working by downloading the repo here: github.com/CartoDB/carto-python, saving it in the python lib folder, and then running setup.py on the command line. Now I'm not having the problem anymore. Would you still suggest using 1.0.0? – Kristen G. Feb 10 '17 at 18:39
  • The 1.0.0 version is planned to be released by the end of this month. So, I would say that is up to you to use the version that fits better to your needs. – oriolbx Feb 13 '17 at 8:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.