googleapis/python-translate

Google Translate with AWS lambda

Mkamal88 opened this issue · 6 comments

I'm trying to deploy a software that translate using google translate on AWS lambda, I got the following error when I tried to fire the lambda:
Runtime.ImportModuleError: Unable to import module 'lambda_function': cannot import name 'cygrpc' from 'grpc._cython'

I'm using Python 3.9
and I uploaded the package with all it's dependences according to the environment.

@Mkamal88 It looks like there might be an issue with the grpc installation.

Can you share the requirements.txt?

Hi @busunkim96 here is the content of my requirements.txt

attrs==21.2.0
Automat==20.2.0
beautifulsoup4==4.10.0
bleach==4.1.0
boto3==1.18.63
botocore==1.21.63
bottle==0.12.19
bottle-cors==0.1.5
cachetools==4.2.4
certifi==2021.10.8
charset-normalizer==2.0.7
colorama==0.4.4
constantly==15.1.0
cygrpc
docutils==0.17.1
docx==0.2.4
google==3.0.0
google-api-core
google-auth==2.3.0
google-cloud==0.34.0
google-cloud-core
google-cloud-translate==3.5.0
googleapis-common-protos==1.53.0
grpcio
grpcio-tools
hyperlink==21.0.0
idna==3.3
importlib-metadata==4.8.1
incremental==21.3.0
jmespath==0.10.0
keyring==23.2.1
lxml==4.6.3
packaging==21.0
Paste==3.5.0
Pillow==8.4.0
pkginfo==1.7.1
proto-plus==1.19.5
protobuf==3.18.1
pyasn1==0.4.8
pyasn1-modules==0.2.8
Pygments==2.10.0
PyHamcrest==2.0.2
pyparsing==2.4.7
python-dateutil==2.8.2
python-docx==0.8.11
pywin32-ctypes==0.2.0
readme-renderer==30.0
requests==2.26.0
requests-toolbelt==0.9.1
rfc3986==1.5.0
rsa==4.7.2
s3transfer==0.5.0
six==1.16.0
soupsieve==2.2.1
tqdm==4.62.3
twine==3.4.2
typing-extensions==3.10.0.2
urllib3==1.26.7
webencodings==0.5.1
zipp==3.6.0
zope.interface==5.4.0

FYI, it looks like there's a similar question on StackOverflow with a couple solutions that might be worth trying.

Thanks @kweinmeister, that looks useful.

I also found GoogleCloudPlatform/python-docs-samples#1540 - could you try pinning to the latest grpcio version in requirements.txt?

grpcio==1.41.1

@Mkamal88 - did any of the suggestions help resolve your issue?

It worked with me when I created the requirements.txt again and installed it on Linux OS