1

我在 ubuntu 中使用 openwhisk,我编写了一个 Python 程序,它依赖于 Google python-api-client 库。如何捆绑代码和 python 库?

4

1 回答 1

3

要使用不属于默认库的 python 依赖项,这些依赖项已经添加到执行操作的环境中,您必须使用 virtualenv。

这里有两个描述,描述了如何使用 virtualenv 为 OpenWhisk 创建 python 操作。 https://github.com/apache/incubator-openwhisk/blob/master/docs/actions.md#packaging-python-actions-with-a-virtual-environment-in-zip-files

http://jamesthom.as/blog/2017/04/27/python-packages-in-openwhisk/

于 2017-08-29T06:33:21.513 回答