SIEM Agent - ImportError: No module named requests.exceptions
search cancel

SIEM Agent - ImportError: No module named requests.exceptions


Article ID: 274603


Updated On:


CASB Security Standard CASB Security Advanced CASB Security Premium CASB Securlet SAAS CASB Advanced Threat Protection CASB Audit CASB Gateway CASB Gateway Advanced


Client attempting to set up a SIEM Agent for CloudSOC on an Ubuntu Server version 22.04.3 LTS

Running with Python3 Client is getting "ImportError: No module named requests.exceptions"

CASB Support ensured pre-requisites were met and Client was following the SIEM API Tech Doc

CSAB Support also getting same error in Lab as client did in their environment after running 'sudo sh'

<ServerName>@<UUsername>:~/SIEM$ python3 --severity all --elastica_app investigate -o FILE -f LogName09292023 --app Elastica --start_date 2023-09-20
Traceback (most recent call last):
  File "/home/<Servername>/SIEM/", line 18, in <module>
    from requests.exceptions import ConnectionError
  File "/usr/local/lib/python3.10/dist-packages/requests/", line 63, in <module>
    from . import utils
  File "/usr/local/lib/python3.10/dist-packages/requests/", line 27, in <module>
    from .cookies import RequestsCookieJar, cookiejar_from_dict
  File "/usr/local/lib/python3.10/dist-packages/requests/", line 172, in <module>
    class RequestsCookieJar(cookielib.CookieJar, collections.MutableMapping):
AttributeError: module 'collections' has no attribute 'MutableMapping'




Analyzed logs further discovered that "requirements.txt" file that came zipped with the SIEM Agent had old 'requests' library version 2.11.1 inside it

requirements.txt file contents as received in SIEM Agent zipped file:

Before the Change:

Edited "requirements.txt" file to contain latest requests version 2.31.0

Re-ran SIEM agent install command sudo sh

SIEM Agent installed successfully on the Lab Ubuntu Server and when Agent was run it successfully pulled data from Lab CloudSOC tenant