stripe.Subscription.create订阅属性不可用

2024-04-25 22:05:16 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在导入stripe==1.75.0,它是通过pip安装的。在

我这样调用时遇到“AttributeError:'module'object has no attribute'Subscription'”错误:

            try:
            subscribe = stripe.Subscription.create(
                customer=customer.id,
                items=[
                    {
                        "plan": plan_id,
                    },
                ]
            )

所有其他属性都可以正常工作条纹.Customer.create或者条纹。充电。创建等等

以下是所有可用的方法: Available Modules

我错过了什么?在


Tags: pipnoidobject错误createattributecustomer
1条回答
网友
1楼 · 发布于 2024-04-25 22:05:16

实际导入的stripe模块可能是较旧的版本。你能检查一下stripe.VERSION的值吗?在

我建议重新安装stripe模块,例如通过pip uninstall stripe然后pip install upgrade stripe。如果您使用的是虚拟环境,请确保在运行pip命令之前已将其激活。在

相关问题 更多 >