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

Invite user giving the API error - new to this library so its basic usage question #60

Open
vickydhas opened this issue Oct 17, 2023 · 3 comments

Comments

@vickydhas
Copy link

vickydhas commented Oct 17, 2023

Inputs in python code:

any API called as per readme file

Output error

Exception ignored in: <function Api.__del__ at 0x1051eb790>
Traceback (most recent call last):
  File "//user-path...//env/lib/python3.9/site-packages/appstoreconnect/api.py", line 72, in __del__
  File "//user-path...//env/lib/python3.9/site-packages/appstoreconnect/api.py", line 333, in _submit_stats
  File "//user-path...//env/lib/python3.9/site-packages/requests/api.py", line 115, in post
  File "//user-path...//env/lib/python3.9/site-packages/requests/api.py", line 59, in request
  File "//user-path...//env/lib/python3.9/site-packages/requests/sessions.py", line 587, in request
  File "//user-path...//env/lib/python3.9/site-packages/requests/sessions.py", line 701, in send
  File "//user-path...//env/lib/python3.9/site-packages/requests/adapters.py", line 489, in send
  File "//user-path...//env/lib/python3.9/site-packages/urllib3/connectionpool.py", line 703, in urlopen
  File "//user-path...//env/lib/python3.9/site-packages/urllib3/connectionpool.py", line 386, in _make_request
  File "//user-path...//env/lib/python3.9/site-packages/urllib3/connectionpool.py", line 1042, in _validate_conn
  File "//user-path...//env/lib/python3.9/site-packages/urllib3/connection.py", line 380, in connect
ModuleNotFoundError: import of time halted; None in sys.modules

I tried doing pip install time / pip3 install time but the module is not found in the pip command.

% pip3 install time --upgrade
ERROR: Could not find a version that satisfies the requirement time (from versions: none)
ERROR: No matching distribution found for time
WARNING: There was an error checking the latest version of pip.
@ppawlak
Copy link
Contributor

ppawlak commented Oct 17, 2023

I tried doing pip install time

Time is a Python built-in package, you don't need to install it.
It looks like there is something wrong with your Python installation but I can't tell what.

From the the traceback I can tell the issue arise in the _submit_stats function, you can disable anonymous data collection by initializing the with api = Api(key_id, path_to_key_file, issuer_id, submit_stats=False). It may help.

@dendihandian
Copy link

dendihandian commented Nov 15, 2023

I'm having this issue right now

code:

from appstoreconnect import Api, UserRole
api = Api(KEY_ID, '.data/appstore_auth.p8', ISSUER_ID)

error:

Exception ignored in: <function Api.__del__ at 0x7fed55845360>
Traceback (most recent call last):
  File "/home/ubuntu/mycode/.venv/lib/python3.10/site-packages/appstoreconnect/api.py", line 72, in __del__
  File "/home/ubuntu/mycode/.venv/lib/python3.10/site-packages/appstoreconnect/api.py", line 333, in _submit_stats
  File "/home/ubuntu/mycode/.venv/lib/python3.10/site-packages/requests/api.py", line 115, in post
  File "/home/ubuntu/mycode/.venv/lib/python3.10/site-packages/requests/api.py", line 59, in request
  File "/home/ubuntu/mycode/.venv/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
  File "/home/ubuntu/mycode/.venv/lib/python3.10/site-packages/requests/sessions.py", line 703, in send
  File "/home/ubuntu/mycode/.venv/lib/python3.10/site-packages/requests/adapters.py", line 486, in send
  File "/home/ubuntu/mycode/.venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 714, in urlopen
  File "/home/ubuntu/mycode/.venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 403, in _make_request
  File "/home/ubuntu/mycode/.venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1053, in _validate_conn
  File "/home/ubuntu/mycode/.venv/lib/python3.10/site-packages/urllib3/connection.py", line 385, in connect
ModuleNotFoundError: import of time halted; None in sys.modules

@xshagg
Copy link

xshagg commented Oct 11, 2024

The exception occurs in _submit_stats() method. Just turn off usage stats submission:
api = Api(key_id, path_to_key_file, issuer_id, submit_stats=False)

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

4 participants