All Apps and Add-ons

add-on cannot import regex python library

fnc-splunk
Engager

Our add-on requires dateparser and within dateparser the regex library is required. I added the libraries to my addon (built with Add-on Builder 4.3) however, it fails in Splunk 9.2 with:

File "/opt/splunk/etc/apps/.../regex/_regex_core.py", line 21, in <module>
import regex._regex as _regex
ModuleNotFoundError: No module named 'regex._regex'

If I try on Splunk 9.3 it works fine. 

I know Python version changed from 3.7 to 3.9 on Splunk 9.3 but the regex version 2024.4.16 seems to be good for Python 3.7

I will appreciate any insight on how to solve this issue.

Labels (3)

Gr0und_Z3r0
Contributor

You can add the dependency in your app's lib folder and import it from there or you can create a requirements.txt file and declare it there and ensure its installed before installing the app. 

Get Updates on the Splunk Community!

Brains, Bytes, and Boston: Learn from the Best at .conf25

When you think of Boston, you might picture colonial charm, world-class universities, or even the crack of a ...

Splunk AppDynamics Agents Webinar Series

Mark your calendars! On June 24th at 12PM PST, we’re going live with the second session of our Splunk ...

SplunkTrust Application Period is Officially OPEN!

It's that time, folks! The application/nomination period for the 2025 SplunkTrust is officially open! If you ...