InvokeScriptedProcessor can only use Jython, if you need real Python consider ExecuteStreamCommand. You won't have access to things like attributes or any fancy flow file processing (you can only read the incoming flow file content as STDIN and overwrite the contents as STDOUT), but shelling out to Python does allow you to bring in CPython modules.
Until NiFi can run on Java 9+, you could try InvokeScriptedProcessor with Groovy and this workaround. Once NiFi can run on Java 9+, you can use the built-in ALPN support and won't need Python per se.