为什么 dev_appserver.py 不能使用新的 google 云端点库?
Why is dev_appserver.py not working with new google cloud endpoints lib?
我正在使用 Windows 7 并在 Python 中的标准环境 Cloud Endpoints Framework 上创建 APIs。当我 运行 命令 dev_appserver.py app.yaml
并转到 http://localhost:8080/_ah/api/explorer 测试我的 API 时,我得到一个导入错误,最后一行是:
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
当我将 API 部署到 google 云时,它工作正常。此外,当我在我的应用程序中使用此库 pip install -t lib google-endpoints --extra-index-url=https://gapi-pypi.appspot.com/admin/nurpc-dev --ignore-installed
的旧版本时,dev_appserver 会按预期工作。我认为这与该库的更新有关?
任何帮助都会很棒。
尝试再次更新您的库,因为最近出现了新版本。看看是否能解决您的问题!
This opened issue with the Google team explains a work around before a fix is released. Work around is also shown in this :
- 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',
我正在使用 Windows 7 并在 Python 中的标准环境 Cloud Endpoints Framework 上创建 APIs。当我 运行 命令 dev_appserver.py app.yaml
并转到 http://localhost:8080/_ah/api/explorer 测试我的 API 时,我得到一个导入错误,最后一行是:
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
当我将 API 部署到 google 云时,它工作正常。此外,当我在我的应用程序中使用此库 pip install -t lib google-endpoints --extra-index-url=https://gapi-pypi.appspot.com/admin/nurpc-dev --ignore-installed
的旧版本时,dev_appserver 会按预期工作。我认为这与该库的更新有关?
任何帮助都会很棒。
尝试再次更新您的库,因为最近出现了新版本。看看是否能解决您的问题!
This opened issue with the Google team explains a work around before a fix is released. Work around is also shown in this
- 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',