[Django]-Django and Stripe, Module 'stripe' has no 'Customer' member

7👍

The one and only reason for this error is you might have either a stripe.py file or a module in your project directory.

and, yes, you have a package named stripe under django braintree directory.

\django braintree\stripe\sales\views.py

How can we verify that?

You can check the location of the module by inspecting the .__file__ attribute of the module.

import stripe
print(stripe.__file__)
            ^^^^^^^^^^^

References

  1. Python Stripe: ‘module’ object has no attribute ‘Charge’ — (StackOverlofw)
  2. AttributeError: ‘module’ object has no attribute ‘Charge’ — (GitHub)

0👍

You have named your project/app as stripe which makes conflict with the stripe package you installed

Change you project/app name to a different name and try again

NOTE: avoid using package name as app name or project name, this will create issues during referencing

Leave a comment