Hello. I am importing the google cloud speech module and am having some trouble with imports. I have included external python path so my sys.path looks like this:
C:\Python37\Lib\site-packages C:\Program Files\Derivative\TouchDesigner.2020.25380\bin C:\Program Files\Derivative\TouchDesigner.2020.25380\bin\python37.zip C:\Program Files\Derivative\TouchDesigner.2020.25380\bin\DLLs C:\Program Files\Derivative\TouchDesigner.2020.25380\bin\lib C:\Program Files\Derivative\TouchDesigner.2020.25380\bin C:/Program Files/Derivative/TouchDesigner.2020.25380/Config/Cmd
I have a script that just imports my modules
from google.cloud import speech from google.cloud.speech import enums from google.cloud.speech import types
I have pip’ed everything in and when I run in the terminal with
py -3.7 script.py it works and imports the modules however when run in touch I get the following output:
Traceback (most recent call last): File "</project1/text1:op('/project1/text1').run()>", line 1 td.Error: File "/project1/text1", line 8 r = previousimport(*args, **kw) File "C:\Python37\Lib\site-packages\google\cloud\speech.py", line 20 from google.cloud.speech_v1 import SpeechClient r = previousimport(*args, **kw) File "C:\Python37\Lib\site-packages\google\cloud\speech_v1\__init__.py", line 17 from google.cloud.speech_v1.gapic import speech_client r = previousimport(*args, **kw) File "C:\Python37\Lib\site-packages\google\cloud\speech_v1\gapic\speech_client.py", line 25 import google.api_core.gapic_v1.config r = previousimport(*args, **kw) File "C:\Python37\Lib\site-packages\google\api_core\gapic_v1\__init__.py", line 18 from google.api_core.gapic_v1 import config r = previousimport(*args, **kw) File "C:\Python37\Lib\site-packages\google\api_core\gapic_v1\config.py", line 23 import grpc r = previousimport(*args, **kw) File "C:\Python37\Lib\site-packages\grpc\__init__.py", line 23 from grpc._cython import cygrpc as _cygrpc ImportError: cannot import name 'cygrpc' from 'grpc._cython' (C:\Python37\Lib\site-packages\grpc\_cython\__init__.py) Results of run operation resulted in exception.
It is looking in the right place and it appears that everything is correct as it works with normal cmd python. Does anyone have any advice for debugging this or have any experience with something like this happening?