<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Import Python Module when creating a new Splunk App in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Import-Python-Module-when-creating-a-new-Splunk-App/m-p/405083#M6979</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am trying to create a new app which requires a python module not included in Splunk. I read somewhere that you can copy the modules and dependencies to the etc/apps/app/bin.  When I do that and try to just import the module I get the following error:&lt;/P&gt;

&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-limac/bin/lc_pythontest_1563939006_862.py", line 14, in &lt;BR /&gt;
    import input_module_lc_pythontest_1563939006_862 as input_module&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-limac/bin/input_module_lc_pythontest_1563939006_862.py", line 8, in &lt;BR /&gt;
    import limacharlie&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-limac/bin/limacharlie/&lt;STRONG&gt;init&lt;/STRONG&gt;.py", line 41, in &lt;BR /&gt;
    from .Manager import Manager&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-limac/bin/limacharlie/Manager.py", line 26, in &lt;BR /&gt;
    from .Sensor import Sensor&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-limac/bin/limacharlie/Sensor.py", line 5, in &lt;BR /&gt;
    from .utils import *&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-limac/bin/limacharlie/utils.py", line 7, in &lt;BR /&gt;
    import gevent.event&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-limac/bin/gevent/&lt;STRONG&gt;init&lt;/STRONG&gt;.py", line 87, in &lt;BR /&gt;
    from gevent.&lt;EM&gt;hub_local import get_hub&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-limac/bin/gevent/_hub_local.py", line 101, in &lt;BR /&gt;
    import_c_accel(globals(), 'gevent.&lt;/EM&gt;&lt;EM&gt;hub_local')&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-limac/bin/gevent/_util.py", line 105, in import_c_accel&lt;BR /&gt;
    mod = importlib.import_module(cname)&lt;BR /&gt;
  File "/opt/splunk/lib/python2.7/importlib/&lt;/EM&gt;&lt;EM&gt;init&lt;/EM&gt;&lt;EM&gt;.py", line 37, in import_module&lt;BR /&gt;
    __import&lt;/EM&gt;&lt;EM&gt;(name)&lt;BR /&gt;
ImportError: /opt/splunk/etc/apps/TA-limac/bin/gevent/&lt;/EM&gt;_hub_local.so: undefined symbol: PyUnicodeUCS4_DecodeUTF8&lt;/P&gt;

&lt;P&gt;Has anyone gotten this before or know a different way to create this app while still using the python module?&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 01:26:39 GMT</pubDate>
    <dc:creator>keith_374</dc:creator>
    <dc:date>2020-09-30T01:26:39Z</dc:date>
    <item>
      <title>Import Python Module when creating a new Splunk App</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Import-Python-Module-when-creating-a-new-Splunk-App/m-p/405083#M6979</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am trying to create a new app which requires a python module not included in Splunk. I read somewhere that you can copy the modules and dependencies to the etc/apps/app/bin.  When I do that and try to just import the module I get the following error:&lt;/P&gt;

&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-limac/bin/lc_pythontest_1563939006_862.py", line 14, in &lt;BR /&gt;
    import input_module_lc_pythontest_1563939006_862 as input_module&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-limac/bin/input_module_lc_pythontest_1563939006_862.py", line 8, in &lt;BR /&gt;
    import limacharlie&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-limac/bin/limacharlie/&lt;STRONG&gt;init&lt;/STRONG&gt;.py", line 41, in &lt;BR /&gt;
    from .Manager import Manager&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-limac/bin/limacharlie/Manager.py", line 26, in &lt;BR /&gt;
    from .Sensor import Sensor&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-limac/bin/limacharlie/Sensor.py", line 5, in &lt;BR /&gt;
    from .utils import *&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-limac/bin/limacharlie/utils.py", line 7, in &lt;BR /&gt;
    import gevent.event&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-limac/bin/gevent/&lt;STRONG&gt;init&lt;/STRONG&gt;.py", line 87, in &lt;BR /&gt;
    from gevent.&lt;EM&gt;hub_local import get_hub&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-limac/bin/gevent/_hub_local.py", line 101, in &lt;BR /&gt;
    import_c_accel(globals(), 'gevent.&lt;/EM&gt;&lt;EM&gt;hub_local')&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-limac/bin/gevent/_util.py", line 105, in import_c_accel&lt;BR /&gt;
    mod = importlib.import_module(cname)&lt;BR /&gt;
  File "/opt/splunk/lib/python2.7/importlib/&lt;/EM&gt;&lt;EM&gt;init&lt;/EM&gt;&lt;EM&gt;.py", line 37, in import_module&lt;BR /&gt;
    __import&lt;/EM&gt;&lt;EM&gt;(name)&lt;BR /&gt;
ImportError: /opt/splunk/etc/apps/TA-limac/bin/gevent/&lt;/EM&gt;_hub_local.so: undefined symbol: PyUnicodeUCS4_DecodeUTF8&lt;/P&gt;

&lt;P&gt;Has anyone gotten this before or know a different way to create this app while still using the python module?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:26:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Import-Python-Module-when-creating-a-new-Splunk-App/m-p/405083#M6979</guid>
      <dc:creator>keith_374</dc:creator>
      <dc:date>2020-09-30T01:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Import Python Module when creating a new Splunk App</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Import-Python-Module-when-creating-a-new-Splunk-App/m-p/405084#M6980</link>
      <description>&lt;P&gt;Did you find a solution to this? Experiencing the same thing while building out a custom search command and attempting to use gevent/grequests&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2020 13:38:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Import-Python-Module-when-creating-a-new-Splunk-App/m-p/405084#M6980</guid>
      <dc:creator>jpolcari22</dc:creator>
      <dc:date>2020-04-17T13:38:51Z</dc:date>
    </item>
  </channel>
</rss>

