Trying to import gemini library

Hey everyone, I’ve been trying to import the Gemini pro library via @alphamoonbase 's TD pip for internal use. I got it working the first time, but subsequent use gives me this import error that I can’t seem to resolve in any way:

> Traceback (most recent call last):

  • File “</project1/TDtechSupport/googlegeminipro/text1>”, line “op(‘/project1/TDtechSupport/googlegeminipro/text1’).run()”*
    td.tdError: File “/project1/TDtechSupport/googlegeminipro/text1”, line 1
  • File “/project1/TDtechSupport/googlegeminipro/td_pip/extPIP”, line 144, in ImportModule*
  • File “C:\Program Files\Derivative\TouchDesigner\bin\Lib\importlib_init_.py”, line 126, in import_module*
  • return _bootstrap._gcd_import(name[level:], package, level)*
  •       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*
    
  • File “”, line 1206, in _gcd_import*
  • File “”, line 1178, in _find_and_load*
  • File “”, line 1149, in _find_and_load_unlocked*
  • File “”, line 690, in _load_unlocked*
  • File “”, line 940, in exec_module*
  • File “”, line 241, in _call_with_frames_removed*
  • File “C:\Users\fireb\Desktop\TDImportCache\lib\google\generativeai_init_.py”, line 45*
  • from google.generativeai import caching*
  • r = previousimport(*args, *kw)
  •    ^^^^^^^^^^^^^^^^^^^^^^^^^^^*
    
  • File “C:\Users\fireb\Desktop\TDImportCache\lib\google\generativeai\caching.py”, line 21*
  • from google.generativeai import protos*
  • r = previousimport(*args, *kw)
  •    ^^^^^^^^^^^^^^^^^^^^^^^^^^^*
    
  • File “C:\Users\fireb\Desktop\TDImportCache\lib\google\generativeai\protos.py”, line 74*
  • from google.ai.generativelanguage_v1beta.types import **
  • r = previousimport(*args, *kw)
  •    ^^^^^^^^^^^^^^^^^^^^^^^^^^^*
    
  • File “C:\Users\fireb\Desktop\TDImportCache\lib\google\ai\generativelanguage_v1beta_init_.py”, line 21*
  • from .services.cache_service import CacheServiceAsyncClient, CacheServiceClient*
  • r = previousimport(*args, *kw)
  •    ^^^^^^^^^^^^^^^^^^^^^^^^^^^*
    
  • File “C:\Users\fireb\Desktop\TDImportCache\lib\google\ai\generativelanguage_v1beta\services\cache_service_init_.py”, line 16*
  • from .async_client import CacheServiceAsyncClient*
  • r = previousimport(*args, *kw)
  •    ^^^^^^^^^^^^^^^^^^^^^^^^^^^*
    
  • File “C:\Users\fireb\Desktop\TDImportCache\lib\google\ai\generativelanguage_v1beta\services\cache_service\async_client.py”, line 32*
  • from google.api_core import gapic_v1*
  • r = previousimport(*args, *kw)
  •    ^^^^^^^^^^^^^^^^^^^^^^^^^^^*
    
  • File “C:\Users\fireb\Desktop\TDImportCache\lib\google\api_core\gapic_v1_init_.py”, line 16*
  • from google.api_core.gapic_v1 import config*
  • r = previousimport(*args, *kw)
  •    ^^^^^^^^^^^^^^^^^^^^^^^^^^^*
    
  • File “C:\Users\fireb\Desktop\TDImportCache\lib\google\api_core\gapic_v1\config.py”, line 26*
  • from google.api_core import retry*
  • r = previousimport(*args, *kw)
  •    ^^^^^^^^^^^^^^^^^^^^^^^^^^^*
    
  • File “C:\Users\fireb\Desktop\TDImportCache\lib\google\api_core\retry_init_.py”, line 17*
  • from .retry_base import exponential_sleep_generator*
  • r = previousimport(*args, *kw)
  •    ^^^^^^^^^^^^^^^^^^^^^^^^^^^*
    
  • File “C:\Users\fireb\Desktop\TDImportCache\lib\google\api_core\retry\retry_base.py”, line 30*
  • import requests.exceptions*
  • r = previousimport(*args, *kw)
  •    ^^^^^^^^^^^^^^^^^^^^^^^^^^^*
    
  • File “C:\Users\fireb\Desktop\TDImportCache\lib\requests_init_.py”, line 43*
  • import urllib3*
  • r = previousimport(*args, *kw)
  •    ^^^^^^^^^^^^^^^^^^^^^^^^^^^*
    
  • File “C:\Users\fireb\Desktop\TDImportCache\lib\urllib3_init_.py”, line 15*
  • from ._base_connection import _TYPE_BODY*
  • r = previousimport(*args, *kw)
  •    ^^^^^^^^^^^^^^^^^^^^^^^^^^^*
    
  • File “C:\Users\fireb\Desktop\TDImportCache\lib\urllib3_base_connection.py”, line 7*
  • from .util.url import Url*
  • r = previousimport(*args, *kw)
  •    ^^^^^^^^^^^^^^^^^^^^^^^^^^^*
    
  • File “C:\Users\fireb\Desktop\TDImportCache\lib\urllib3\util_init_.py”, line 5*
  • from .request import SKIP_HEADER, SKIPPABLE_HEADERS, make_headers*
  • r = importDAT(args[0]);*
  •    ^^^^^^^^^^^^^^^^^^*
    

td.tdError: Module compilation error. See /project1/TDtechSupport/googlegeminipro/request for details.
Results of run operation resulted in exception.

if anyone can help me I will be able to build the component and publish it as a community resource, allowing anyone to use google’s gemini pro from within touchdesigner and access its powerful llm capabilities

Can you please describe what you mean by “subsequent use”? Create an easy to follow step by step description of what leads you to the error.
Please use propper codeTags.

```python
youCodeHere
```

Google is nototrious for installing several package elements in to the same folder, which can result in issues. But as long as you only use on google library it should be fine.