You can package Python dependencies by using a virtual environment, virtualenv. The virtual environment allows you to link additional packages that can be installed by using pip, for example.
To install dependencies, package them in a virtual environment, and create a compatible OpenWhisk action:
Create a requirements.txt file that contains the pip modules and versions to install.
Install the dependencies and create a virtual environment. The virtual environment directory must be named virtualenv. To ensure compatibility with the OpenWhisk runtime container, package installations inside a virtual environment must use the image that corresponds to the kind.
For kind python:2 use the docker image openwhisk/python2action.
For kind python:3.6 use the docker image ibmfunctions/action-python-v3.6.
For kind python:3.7 use the docker image ibmfunctions/action-python-v3.7.
docker run --rm -v "$PWD:/tmp" ibmfunctions/action-python-v3 bash -c "cd tmp && virtualenv virtualenv && source virtualenv/bin/activate && pip install -r requirements.txt"
Package the virtualenv directory and any additional Python files. The source file that contains the entry point must be named main.py.
zip -r helloPython.zip virtualenv __main__.py
Create the action helloPython.
ibmcloud fn action create helloPython --kind python-jessie:3 helloPython.zip
For more details, refer this link