我正在导入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或者条纹。充电。创建等等
我错过了什么?在
实际导入的
stripe
模块可能是较旧的版本。你能检查一下stripe.VERSION
的值吗?在我建议重新安装
stripe
模块,例如通过pip uninstall stripe
然后pip install upgrade stripe
。如果您使用的是虚拟环境,请确保在运行pip
命令之前已将其激活。在相关问题 更多 >
编程相关推荐