taers232c / GAMADV-XTD3

Command line tool to manage Google Workspace
741 stars 88 forks source link

Cannot invoke inside bash #450

Open ivdok opened 1 day ago

ivdok commented 1 day ago

Normal commands, like gam print addresses, execute correctly, but when called from bash script, interactively or not, I'm getting errors about random python module not being found despite being installed and present:

takeout]$ while read cmds; do echo "Running $cmds..."; $cmds; echo "Stopped running $cmds..."; echo ""; sleep 3; done <cmds.txt 
Running gam print addresses...
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/google/auth/transport/requests.py", line 26, in <module>
    import requests
  File "/home/ivdok/.local/lib/python3.12/site-packages/requests/__init__.py", line 43, in <module>
    import urllib3
  File "/home/ivdok/.local/lib/python3.12/site-packages/urllib3/__init__.py", line 7, in <module>
    from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
  File "/home/ivdok/.local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 11, in <module>
    from .exceptions import (
  File "/home/ivdok/.local/lib/python3.12/site-packages/urllib3/exceptions.py", line 2, in <module>
    from .packages.six.moves.http_client import IncompleteRead as httplib_IncompleteRead
ModuleNotFoundError: No module named 'urllib3.packages.six.moves'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/share/gam/gam.py", line 6, in <module>
    from gam.__main__ import main
  File "/usr/share/gam/gam/__init__.py", line 50, in <module>
    import gam.auth.oauth
  File "/usr/share/gam/gam/auth/__init__.py", line 11, in <module>
    from gam.auth import oauth
  File "/usr/share/gam/gam/auth/oauth.py", line 19, in <module>
    import google_auth_oauthlib.flow
  File "/usr/lib/python3.12/site-packages/google_auth_oauthlib/__init__.py", line 21, in <module>
    from .interactive import get_user_credentials
  File "/usr/lib/python3.12/site-packages/google_auth_oauthlib/interactive.py", line 27, in <module>
    import google_auth_oauthlib.flow
  File "/usr/lib/python3.12/site-packages/google_auth_oauthlib/flow.py", line 65, in <module>
    import google.auth.transport.requests
  File "/usr/lib/python3.12/site-packages/google/auth/transport/requests.py", line 28, in <module>
    raise ImportError(
ImportError: The requests library is not installed from please install the requests package to use the requests transport.
Stopped running gam print addresses...

GAMADV-XTD3 7.01.00 - https://github.com/taers232c/GAMADV-XTD3 - pyinstaller Ross Scroggs ross.scroggs@gmail.com Python 3.13.0 64-bit final Linux Arch Rolling N/A x86_64 Path: /home/ivdok/bin/gamadv-xtd3 Config File: /home/ivdok/.gam/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: Time: 2024-11-23T14:18:00+00:00

taers232c commented 1 day ago

I have a few minutes now (8:52am 11/23), send me a Meet/Zoom invitation.

What does this do: gam info domain

taers232c commented 1 day ago

Try this: gam config num_threads 1 show_commands true batch cmds.txt