尝试在本地运行Google Cloud终结点,但遇到了不同的错误。例如,当我运行时:
$ dev_appserver.py ./app.yaml
它启动,但是当GET到达本地服务器时抛出此错误:
ImportError:没有名为端点的模块
如果我进入python并运行导入,则会收到此错误:
$ python
Python 2.7.10 (default, Feb 22 2019, 21:17:52)
[GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.37.14)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import endpoints
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/me/Library/Python/2.7/lib/python/site-packages/endpoints/__init__.py", line 25, in <module>
from protorpc import message_types
ImportError: No module named protorpc
>>>
protorpc导入是在端点导入之后进行的,因此很明显,端点已安装在我的系统上,但是通过dev appserver运行时找不到它。