Reputation: 125
I am trying to learn the mail chimp API in python 3, but I cannot get it started.
from mailchimp3 import MailChimp
client = MailChimp('MY-USERNAME’,‘MY-API')
(obviously I swapped out my username and api key for this example)
Traceback (most recent call last):
File "/Users/jb/Documents/test2.py", line 3, in <module>
client = MailChimp('MY-USERNAME’,‘MY-API')
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mailchimp3/__init__.py", line 96, in __init__
super(MailChimp, self).__init__(*args, **kwargs)
TypeError: __init__() missing 1 required positional argument: 'mc_secret'
I'm very new to python and API's in general, but typically I can find someone else who has had the same error, but all my searches come up blank. I looked in the MailChimp module and I can see that it is suppose to take my API key as the mc_secret argument, so I'm not sure why I keep getting this error. I did just create my mail chimp account today, so perhaps mail chimp takes a while to activate the key or something?
Upvotes: 0
Views: 213
Reputation: 125
well....I feel sort of stupid.
I just retyped it (instead of copy and pasting it from the documentation) and it worked. I should have noticed that the ',' between the arguments was green in IDLE, indicating something was wrong with the text (encoding or something?). Now it works. Lesson learned, don't just copy and paste from documentation.
Upvotes: 1