{"record":{"id":"2d855951e41b963f","repo":"xtekky/gpt4free","slug":"a2wsgi-is-required-for-gui-install-it-with-pip-i","errorCode":null,"errorMessage":"a2wsgi is required for GUI. Install it with: pip install a2wsgi","messagePattern":"a2wsgi is required for GUI\\. Install it with: pip install a2wsgi","errorType":"exception","errorClass":"MissingRequirementsError","httpStatus":null,"severity":"error","filePath":"g4f/api/__init__.py","lineNumber":456,"sourceCode":"                \"request_headers\": _sanitize_headers(dict(request.headers)),\n                \"request_body\": req_body,\n                \"response_headers\": resp_headers_log,\n                \"response_body\": resp_body,  # None for SSE until iterator completes\n            }\n        )\n        _request_log.append(log_entry)\n\n        return response\n\n    api = Api(app)\n\n    api.register_routes()\n    api.register_authorization()\n    api.register_validation_exception_handler()\n\n    if AppConfig.gui:\n        if not has_a2wsgi:\n            raise MissingRequirementsError(\n                \"a2wsgi is required for GUI. Install it with: pip install a2wsgi\"\n            )\n        gui_app = WSGIMiddleware(\n            get_gui_app(AppConfig.demo, AppConfig.timeout, AppConfig.stream_timeout)\n        )\n        app.mount(\"/\", gui_app)\n\n    if AppConfig.ignored_providers:\n        for provider in AppConfig.ignored_providers:\n            if provider in ProviderUtils.convert:\n                ProviderUtils.convert[provider].working = False\n\n    return app\n\n\ndef create_app_debug():\n    g4f.debug.logging = True\n    return create_app()","sourceCodeStart":438,"sourceCodeEnd":474,"githubUrl":"https://github.com/xtekky/gpt4free/blob/973504e1770928ed5fb82f43da528f441ad9ddc3/g4f/api/__init__.py#L438-L474","documentation":"Error \"a2wsgi is required for GUI. Install it with: pip install a2wsgi\" thrown in xtekky/gpt4free.","triggerScenarios":"Thrown at g4f/api/__init__.py:456 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install a2wsgi: pip install a2wsgi."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"973504e1770928ed5fb82f43da528f441ad9ddc3","analyzedAt":"2026-08-14T23:45:32.408Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}