SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
[fix] ModuleNotFoundError: No module named 'lxml' (#5254)
Markus Heiser34eb32f4185a
diff --git a/searx/exceptions.py b/searx/exceptions.pyindex 226b209ca..54d0b17b1 100644--- a/searx/exceptions.py+++ b/searx/exceptions.py@@ -2,7 +2,9 @@"""Exception types raised by SearXNG modules."""import typing as t-from lxml.etree import XPath++if t.TYPE_CHECKING:+ from lxml.etree import XPathclass SearxException(Exception):@@ -40,7 +42,7 @@ class SearxEngineException(SearxException):class SearxXPathSyntaxException(SearxEngineException):"""Syntax error in a XPATH"""- def __init__(self, xpath_spec: str | XPath, message: str):+ def __init__(self, xpath_spec: "str | XPath", message: str):super().__init__(str(xpath_spec) + " " + message)self.message: str = message# str(xpath_spec) to deal with str and XPath instance@@ -111,7 +113,7 @@ class SearxEngineTooManyRequestsException(SearxEngineAccessDeniedException):class SearxEngineXPathException(SearxEngineResponseException):"""Error while getting the result of an XPath expression"""- def __init__(self, xpath_spec: str | XPath, message: str):+ def __init__(self, xpath_spec: "str | XPath", message: str):super().__init__(str(xpath_spec) + " " + message)self.message: str = message# str(xpath_spec) to deal with str and XPath instance