Driver 'python' isn't loaded

I have tried using the python rich plugin with TYK on docker.
The api works but the middleware doesn’t.
TYK outputs the following message:

level=error msg=“Driver ‘python’ isn’t loaded” prefix=coprocess


“listen_address”: “”,
“listen_port”: 8080,
“secret”: “352d20ee67be67f6340b4c0605b044b7”,
“template_path”: “/opt/tyk-gateway/templates”,
“use_db_app_configs”: false,
“app_path”: “/opt/tyk-gateway/apps”,
“middleware_path”: “/opt/tyk-gateway/middleware”,
“storage”: {
“type”: “redis”,
“host”: “localhost”,
“port”: 6379,
“username”: “”,
“password”: “”,
“database”: 0,
“optimisation_max_idle”: 2000,
“optimisation_max_active”: 4000
“enable_analytics”: false,
“analytics_config”: {
“type”: “”,
“ignored_ips”: []
“dns_cache”: {
“enabled”: false,
“ttl”: 3600,
“check_interval”: 60
“allow_master_keys”: false,
“policies”: {
“policy_source”: “file”
“coprocess_options”: {
“enable_coprocess”: true,
“python_path_prefix”: “/opt/tyk-gateway”
“hash_keys”: true,
“suppress_redis_signal_reload”: false,
“force_global_session_lifetime”: false,
“max_idle_connections_per_host”: 500

API definition:

“name”: “Tyk Test API”,
“api_id”: “1”,
“org_id”: “default”,
“definition”: {
“location”: “header”,
“key”: “version”
“use_keyless”: true,
“auth”: {
“auth_header_name”: “authorization”
“version_data”: {
“not_versioned”: true,
“versions”: {
“Default”: {
“name”: “Default”,
“expires”: “3000-01-02 15:04”,
“use_extended_paths”: true,
“extended_paths”: {
“ignored”: [],
“white_list”: [],
“black_list”: []
“custom_middleware”: {
“pre”: [
“name”: “PreHook”,
“path”: “./bundles/”
“driver”: “python”
“proxy”: {
“listen_path”: “/v/”,
“target_url”: “”,
“strip_listen_path”: true
“enable_batch_request_support”: true

from tyk.decorators import *
from gateway import TykGateway as tyk
from time import time

def PreHook(request, session, spec):
tyk.log(“PreHook is called”, “info”)
# Inject a header:
request.add_header(“testheader”, “testvalue”)
return request, session

def ResponseHook(request, response, session, metadata, spec):
tyk.log(“ResponseHook is called”, “info”)
# In this hook we have access to the response object, to inspect it, uncomment the following line:
# print(response)
tyk.log(“ResponseHook: upstream returned {0}”.format(response.status_code), “info”)
return response

Also when I use the ResponseHook
with the following definition:
“response”: [
“name”: “ResponseHook”,
“path”: “./bundles/”

The middleware still don’t work and no error output message is written.

Is something wrong with this configuration?
Or maybe my docker image is missing something?

Thanks in advence.

Hi, could you share a full gateway log in debug mode?

  1. Set “log_level” to “debug” in tyk.conf, alternatively you can set the TYK_LOGLEVEL environment variable to “debug”.
  2. Start the gateway and copy the full log. Paste it here.