How can I use external python library in Apache OpenWhisk?

743 views Asked by At

I am using openwhisk in ubuntu, I have written a Python program which has a dependency on Google python-api-client library. How can I bundle both code and python library ?

1

There are 1 answers

0
cbickel On BEST ANSWER

To use python dependencies, that are not part of the default libraries, that are already added to the environment, where the action is executed, you have to use virtualenv.

Here are two descriptions, that describe how you can create a python action for OpenWhisk using virtualenv. 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/