I am using Windows 7 and creating APIs on the standard environment Cloud Endpoints Framework in Python. When I run command dev_appserver.py app.yaml
and go to http://localhost:8080/_ah/api/explorer to test my API I get an ImportError with the last lines being:
File "C:\Python27\lib\platform.py", line 632, in win32_ver from _winreg
import OpenKeyEx, QueryValueEx, CloseKey, HKEY_LOCAL_MACHINE
File "C:\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\
google\appengine\tools\devappserver2\python\sandbox.py", line 964, in load_module
raise ImportError('No module named %s' % fullname)
ImportError: No module named _winreg
When I deploy the API to google cloud it works fine. Also, when I use an older version of this library pip install -t lib google-endpoints --extra-index-url=https://gapi-pypi.appspot.com/admin/nurpc-dev --ignore-installed
in my application, the dev_appserver works as expected. I think it's something to do with an update to this library?
Any help would be great.
This opened issue with the Google team explains a work around before a fix is released. Work around is also shown in this answer:
- Go to: <sdk_root>\google\appengine\tools\devappserver2\python\sandbox.py
- Find the definition of _WHITE_LIST_C_MODULES = [xxx]
- Add the following two lines to the list: '_winreg', '_ctypes',