Sendgrid-python: Quick start doesn't work with python 3.6.7 and sendgrid 5.6.0

Created on 5 Mar 2019  路  7Comments  路  Source: sendgrid/sendgrid-python

Issue Summary

I'm trying to tutorial of sendgrid but quickstart doesn't work in my environment.
is this due to my enviroment or bug?

I copied quick start code and executed,
https://github.com/sendgrid/sendgrid-python

this error message was shown

Traceback (most recent call last):
  File "sendgrid.py", line 1, in <module>
    import sendgrid
  File "c:\ang\gurucho-back\modules\sendgrid.py", line 3, in <module>
    from sendgrid.helpers.mail import *
ModuleNotFoundError: No module named 'sendgrid.helpers'; 'sendgrid' is not a package

if i comment out 'from sendgrid.helpers.mail import *'
this error massage was shown

Traceback (most recent call last):
  File "sendgrid.py", line 1, in <module>
    import sendgrid
  File "c:\ang\gurucho-back\modules\sendgrid.py", line 7, in <module>
    sg = sendgrid.SendGridAPIClient(apikey=SENDGRID_API_KEY)
AttributeError: module 'sendgrid' has no attribute 'SendGridAPIClient'

Technical details:

  • sendgrid-python 5.6.0
  • Python Version: 3.6.7
unknown or a waiting for feedback question

Most helpful comment

Sorry, it's solved.
I named my sample code as "sendgrid.py", so it import itself as sendgrid module.
Thank you for kindly support

All 7 comments

Hello @punisuke,

Please try the quick start here.

I have changed the default branch to v4, because that is the one under active development. But if you are using the current version, then the master branch is where you want to look.

My apologies for the confusion.

With Best Regards,

Elmer

Having the same issue with Python 3.6.4.

pip3 install sendgrid
Collecting sendgrid
Using cached https://files.pythonhosted.org/packages/24/21/9bea4c51f949497cdce11f46fd58f1a77c6fcccd926cc1bb4e14be39a5c0/sendgrid-5.6.0-py2.py3-none-any.whl
Requirement already satisfied: python-http-client>=3.0 in /usr/local/lib/python3.7/site-packages (from sendgrid) (3.1.0)
Installing collected packages: sendgrid

I tried again after uninstall sendgrid, but i have same issue.
would you give me any advice?

Hello @hasib32 @punisuke ,

Could you please run this command on your command line and tell me what version you have installed?

pip3 list | grep sendgrid*

And then, could you please provide the quick start code you are using? Thanks!

With Best Regards,

Elmer

Sorry, it's solved.
I named my sample code as "sendgrid.py", so it import itself as sendgrid module.
Thank you for kindly support

Thanks for the follow up @punisuke, I'm glad that was resolved!

How about you @hasib32, are you still having trouble?

Sorry, it's solved.
I named my sample code as "sendgrid.py", so it import itself as sendgrid module.
Thank you for kindly support

Danm I did that stupid thing too. Thank you and thank Google I found this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hugomallinson picture hugomallinson  路  3Comments

andriisoldatenko picture andriisoldatenko  路  4Comments

lipis picture lipis  路  3Comments

sohamnavadiya picture sohamnavadiya  路  4Comments

debugger22 picture debugger22  路  5Comments