Sendgrid-python: AttributeError: 'module' object has no attribute 'SendGridClient'

Created on 19 Jan 2015  路  4Comments  路  Source: sendgrid/sendgrid-python

_I am trying to send emails via sendgrid in django. But each time it says;_

sg = sendgrid.SendGridClient(settings.SENDGRID_USERNAME, settings.SENDGRID_PASSWORD, raise_errors=True)

AttributeError: 'module' object has no attribute 'SendGridClient'

However in requirements.txt file sendgrid ok and also import sendgrid.
and in setttings file it is properly configured.

Most helpful comment

make sure you do not have any other file named as "sendgrid"

All 4 comments

Are you using virtualenv? Make sure you install it on your local environment. Also, you can take a look at this lib:
https://github.com/elbuo8/sendgrid-django

make sure you do not have any other file named as "sendgrid"

Could very well be it @changhaz. Thanks for the insight!

@elbuo8 i was using it without virtualenv, So i setup venv and problem is solved. thanks

Was this page helpful?
0 / 5 - 0 ratings