Use boto3 for GAE for Python

I am trying to use boto3 for the Polly API in the Google App Engine for Python. So far I have installed boto3 in my lib subdirectory

pip install -t lib boto3

When I run a stand-alone script, it works well. But when I execute boto3.client (...) in my application on my DEV server, I get the error botocore / session.py:

from _winreg import OpenKeyEx, QueryValueEx, CloseKey, HKEY_LOCAL_MACHINE
ImportError: No module named _winreg

I saw that since GAE is sandboxed, so itโ€™s normal that the _winreg module is unavailable

Does anyone have any experience installing boto3 in GAE and running it on a DEV and PROD server?

Or is there another way to use the Polly API?

As @ simon-pierre pointed out below the _winreg error, you can solve it by editing config_appengine.py and adding:

import sys
sys.plateform='linux3'

But then I ran another issue

Python NameError: 'ssl' . , app.yaml ssl :

libraries:
- name: ssl
  version: 2.7.11

, GAE Windows: _ssl RAND_egd ImportError: RAND_egd. sochet.py

socket.py, , : https://code.google.com/p/googleappengine/issues/detail?id=12783

, :

DEV AWS: ConnectionError: ( " .", (13, " " )) client.describe_voices ( "en-US" ) DEV GAE, , script .

SDK PayPal PayPal, - AWS boto3

https://github.com/paypal/PayPal-Python-SDK/issues/66

?

0
1

: appengine_config.py sys.platform:

import sys
sys.platform = 'linux3'

, App Engine _winreg. (: fooobar.com/questions/1014325/...)

Google App Engine,

Python >= 2.7.4 sys.platform โ€‹โ€‹ linux3 sanbox dev_appserver Windows, App Engine SDK >= 1.9.34. [...] , sandbox.py sys.platform = 'linux3' .

+2

Source: https://habr.com/ru/post/1014305/


All Articles