Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'stripe.six.moves' #18

Closed
technolion opened this issue Nov 7, 2024 · 5 comments
Closed

ModuleNotFoundError: No module named 'stripe.six.moves' #18

technolion opened this issue Nov 7, 2024 · 5 comments

Comments

@technolion
Copy link

Maybe a noob question, but please help:

(venv) tom@spix-2 stripe-datev-exporter % python3 stripe-datev-cli.py download 2024 1
Traceback (most recent call last):
  File "/Users/tom/Development/stripe-datev-exporter/stripe-datev-cli.py", line 7, in <module>
    import stripe
  File "/Users/tom/Development/stripe-datev-exporter/venv/lib/python3.13/site-packages/stripe/__init__.py", line 34, in <module>
    from stripe.api_resources import *  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tom/Development/stripe-datev-exporter/venv/lib/python3.13/site-packages/stripe/api_resources/__init__.py", line 6, in <module>
    from stripe.api_resources.error_object import ErrorObject, OAuthErrorObject
  File "/Users/tom/Development/stripe-datev-exporter/venv/lib/python3.13/site-packages/stripe/api_resources/error_object.py", line 3, in <module>
    from stripe.util import merge_dicts
  File "/Users/tom/Development/stripe-datev-exporter/venv/lib/python3.13/site-packages/stripe/util.py", line 13, in <module>
    from stripe.six.moves.urllib.parse import parse_qsl
ModuleNotFoundError: No module named 'stripe.six.moves'
(venv) tom@spix-2 stripe-datev-exporter % 

I have installed all required modules:

(venv) tom@spix-2 stripe-datev-exporter % pip list
Package           Version
----------------- ---------
autopep8          2.0.4
certifi           2024.8.30
chardet           3.0.4
datedelta         1.2
idna              2.8
pip               24.3.1
pycodestyle       2.12.1
python-dotenv     0.19.2
pytz              2018.9
requests          2.21.0
six               1.16.0
stripe            2.64.0
tomli             2.0.1
typing_extensions 4.12.2
urllib3           1.24.3
(venv) tom@spix-2 stripe-datev-exporter % 
(venv) tom@spix-2 stripe-datev-exporter % python --version
Python 3.13.0
(venv) tom@spix-2 stripe-datev-exporter % 

I have a feeling, that I am doing a basic mistake, since I am a python starter...

@technolion
Copy link
Author

I found this: nigelpoulton/ckad#39
And indeed, downgrading to python 3.11 resolves the problem. Maybe this project should use a newer version of the stripe library?

@jonaswitt
Copy link
Owner

Thanks for your feedback! Indeed, we do not always have time to test with the very latest Python version. I have made the supported Python version (3.9) clearer in the Readme. You may find that it works with other Python versions higher than 3.9 but below 3.13, or try upgrading the stripe library version. Let me know what you find.

@technolion
Copy link
Author

Thanks, Jonas, for updating the README. With 3.9 it works as well as with 3.11. At least the script gets further:

(venv) tom@spix-2 stripe-datev-exporter % python3.9 stripe-datev-cli.py download 2024 10
Retrieving data between 2024-10-01 and 2024-10-31 (inclusive, Europe/Berlin)
Retrieved 9 invoice(s), total 19.71 EUR
Traceback (most recent call last):
  File "/Users/tom/Development/stripe-datev-exporter/stripe-datev-cli.py", line 268, in <module>
    StripeDatevCli().run(sys.argv)
  File "/Users/tom/Development/stripe-datev-exporter/stripe-datev-cli.py", line 52, in run
    getattr(self, args.command)(argv[2:])
  File "/Users/tom/Development/stripe-datev-exporter/stripe-datev-cli.py", line 82, in download
    revenue_items = stripe_datev.invoices.createRevenueItems(invoices)
  File "/Users/tom/Development/stripe-datev-exporter/stripe_datev/invoices.py", line 133, in createRevenueItems
    accounting_props = customer.getAccountingProps(cus, invoice=invoice)
  File "/Users/tom/Development/stripe-datev-exporter/stripe_datev/customer.py", line 87, in getAccountingProps
    raise Exception("Expected 'accountNumber' in metadata")
Exception: Expected 'accountNumber' in metadata
(venv) tom@spix-2 stripe-datev-exporter % 

This new error seems to be either configuration-related or my Stripe account is set up differently. What do you think?

@jonaswitt
Copy link
Owner

Sorry, I guess this project is in a "read the code, then run it" stage.

Run the fill_account_numbers command before download. This assigns the accountNumber metadata to each customer, this will be the account number for all booking records related to this customer. You can assign the accountNumber metadata using a different approach, if you like, but every customer (which has any transactions) needs this metadata.

@technolion
Copy link
Author

Run the fill_account_numbers command before download. This assigns the accountNumber metadata to each customer, this will be the account number for all booking records related to this customer. You can assign the accountNumber metadata using a different approach, if you like, but every customer (which has any transactions) needs this metadata.

This is a really valuable info! :-) Now it works for me! 🥳
Would be lovely if that would be added to the README. Thanks for this great package. As far as I see it, it's the only free solution out there..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants