Creating a wrapper to call a Python installation on the host has been the conventional Splunk wisdom for years, as was bundling needed modules into the app. Both these approaches have numerous problems though. Using the wrapper is typically temperamental to permissions, environment variables, and in the case of the default system Python possibly versions of Python even older than 2.7.
My suggestion is to check out a new app I've written called PyDen which allows you to create Python virtual environments and install PyPI packages to the environment. You can then use these environments to execute custom commands and scripted inputs.
This provides three key advantages:
You can pick the version of Python you'd like to write in, including 3.5 to 3.7
Create an isolated environment that won't interfere with imports in other apps (this can happen when packages are bundled into apps)
Install any package available on PyPI to the environment
... View more