#ontheloo
1 messages · Page 1 of 1 (latest)
What version of the python library are you using?
And what happens when you try to use that?
any suggestions?
Are you able to access other Stripe functionality? The top of that error message says stripe is not a package at a point which makes it sound like your code may not be able to use Stripe at all
i am, the stripe is not a package error comes in when i attempt to directly import PaymentLink from stripe.api_resources
you can try to run this code directly, stripe.PaymentLink doesn't seem to be visible from the stripe package
ran clean in my terminal and attempted to rerun the file
Gotcha, will try that myself in a minute. Bouncing between a couple other threads but should be back soon
What do you get if you print(stripe.version.VERSION)?
If I do that using 5.2.0 and have a line stripe.PaymentLink.create() I get:
5.2.0
...
stripe.error.InvalidRequestError: Request req_Fmrln1j0JCL08v: Missing required param: line_items.
(expected because i supplied no parameters)
turns out the import doesn't seem to be working like @versed saffron mentioned. i installed in my virtualenv via pip install stripe, i should be able to import it.. any idea what's going on? i was able to use it in a jupyter notebook within the same virtualenv but not in the script
Interesting. I also have my python install in a virtualenv but I am able to access stripe.PaymentLinks that way.
Trying to think of what this might be.
Oh interesting your other package imports aren't quite working in this script either?
okay so turns out i was executing just one file instead of the entire app, which was the reason the imports weren't working properly. i'm able to print out the versions now, but pylint doesn't seem to recognize the imports at all
stripe.version.VERSION works, but shows up as an error
Good to hear there is progress at least. Are the other calls working now as well?
Not immediately but I will see if I can find anything
seems that some methods are missing type stubs, which could be causing this issue https://github.com/microsoft/pylance-release/issues/484
Stepping in and taking a look here
👋 I'm also stepping in here @agile saffron - just to summarize the current state, is it just the remaining question on linter support or is the library not working at all for you still?
just linter support!
let me see what I can find (give me a bit)
you're using the latest version of PyTorch?
Also when you say "stripe.version.VERSION works, but shows up as an error" you're referring to the linter complaining right?
we're not using pytorch, but seems stripe's api's have the same issue that pytorch
yup!
Gotcha! Yeah I think you're seeing something similar to this - https://github.com/stripe/stripe-python/issues/871 ?
Describe the bug When using mypy to type check code, an error is thrown when trying to access the search method of any resource that subclasses SearchableAPIResource (for example, stripe.Price). Fu...
seems like it yup!
I'm going to keep looking, but in parallel I'd suggest you go ahead and file a github issue with the stripe-python and someone will definitely fix it