I have installed Stripe on my MacOSX Mavericks Macbook Pro (python 2.7) using
but I always get the following error message:
$ sudo python stripe.py
Traceback (most recent call last):
File "stripe.py", line 1, in <module>
import stripe
File "/Users/sebastian/Desktop/stripe.py", line 7, in <module>
resp = stripe.Charge.create(
AttributeError: 'module' object has no attribute 'Charge'
when I try to execute the following script:
import stripe
stripe.api_key = 'my_test_secret_key'
resp = stripe.Charge.create(
amount=200,
currency='usd',
card={
'number': '4242424242424242',
'exp_month': 10,
'exp_year': 2014
},
description='[email protected]'
)
You have another file that is called stripe.py
, so this file is getting imported instead of the stripe
library.
Here's how you fix this:
stripe.py
file to something differentstripe.pyc
if it exists (mind the c
)Said file is on your desktop: /Users/sebastian/Desktop/stripe.py
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With