[Fixed]-Django Storages – Could Not Load Amazon's S3 Bindings Errors

29👍

Do you have python-boto installed?
pip install boto
or
pip install boto3

5👍

Consider using boto3 instead of the older boto:

requirements.txt:

pip install django-storages
pip install boto3

settings.py:

DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
👤Mr-IDE

4👍

Had this issue recently on TravisCI with a Django repo

Running python manage.py compress failed with the error:

Could not load Boto’s S3 bindings.

It happened to be an issue with boto trying to import google-compute-engine module that was not installed.

One way to fix the problem is by installing GCE engine with

pip install google-compute-engine

EDIT:

After investigation, it appears that this particular problem is due to Travis being on GCE, and GCE having a default /etc/boto.cfg file, which prompts boto to look for the GCE engine.

Another way to fix this problem on Travis without installing more dependencies is to set the default config with BOTO_CONFIG to point to nowhere by setting the variable

BOTO_CONFIG=/tmp

in your travis.yml

See this Issue
https://github.com/boto/boto/issues/3741

👤MrE

1👍

in answer to your comment above, it sounds like you are using the wrong settings, check this one:

DEFAULT_FILE_STORAGE = 'storages.backends.s3.S3Storage'

0👍

For the First setting you are trying i.e :

DEFAULT_FILE_STORAGE = 'libs.storages.backends.S3Storage.S3Storage'

It means if the code for storage is present in your ‘libs.storages’ directory in your python path, then it should be accessed like above.

But if you have installed django-storages using setup.py or pip or easy_install, then following 2 options are there:

A. Amazone S3Python based library:

DEFAULT_FILE_STORAGE = 'storages.backends.s3.S3Storage'
  • A simple interface between python and S3

B. Python Boto based library:

DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
  • Based on python boto, and supports much advanced features e.g. connection pooling etc.

  • But you are required to install python boto for using it, e.g pip install boto

0👍

The link in the error message, http://developer.amazonwebservices.com/connect/entry.jspa?externalID=134, seems to work now (June 2014). If you follow it and download, unpack the .zip file and put S3.py on your Python path (i.e. in site-packages), it all works.

Leave a comment