<?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 Re: How to add cryptography or other python lib to Splunk python own environment for scripted input on HF? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-to-add-cryptography-or-other-python-lib-to-Splunk-python-own/m-p/743771#M11887</link>
    <description>&lt;P&gt;Don't add to or touch the Python libraries that ship with Splunk as they will be replaced with each upgrade.&amp;nbsp; Put the required libraries (that Splunk doesn't provide) in your app.&amp;nbsp; This is the way.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Apr 2025 11:52:31 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2025-04-08T11:52:31Z</dc:date>
    <item>
      <title>How to add cryptography or other python lib to Splunk python own environment for scripted input on HF?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-add-cryptography-or-other-python-lib-to-Splunk-python-own/m-p/743758#M11886</link>
      <description>&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;how to add cryptography or other python lib to Splunk python own environment for scripted input on HF?&lt;/P&gt;&lt;P&gt;Preferred solution is to put beside my app in etc/apps/myapp/bin/ folder.&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2025 10:17:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-add-cryptography-or-other-python-lib-to-Splunk-python-own/m-p/743758#M11886</guid>
      <dc:creator>splunkreal</dc:creator>
      <dc:date>2025-04-08T10:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to add cryptography or other python lib to Splunk python own environment for scripted input on HF?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-add-cryptography-or-other-python-lib-to-Splunk-python-own/m-p/743771#M11887</link>
      <description>&lt;P&gt;Don't add to or touch the Python libraries that ship with Splunk as they will be replaced with each upgrade.&amp;nbsp; Put the required libraries (that Splunk doesn't provide) in your app.&amp;nbsp; This is the way.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2025 11:52:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-add-cryptography-or-other-python-lib-to-Splunk-python-own/m-p/743771#M11887</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2025-04-08T11:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to add cryptography or other python lib to Splunk python own environment for scripted input on HF?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-add-cryptography-or-other-python-lib-to-Splunk-python-own/m-p/743779#M11888</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;thanks, how do you add library to custom app? In bin folder with .py file?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2025 12:26:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-add-cryptography-or-other-python-lib-to-Splunk-python-own/m-p/743779#M11888</guid>
      <dc:creator>splunkreal</dc:creator>
      <dc:date>2025-04-08T12:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to add cryptography or other python lib to Splunk python own environment for scripted input on HF?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-add-cryptography-or-other-python-lib-to-Splunk-python-own/m-p/743788#M11889</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Place the third-party Python library inside your app's lib&amp;nbsp;directory, then add this path to sys.path at the start of your scripted input.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;PRE&gt;import sys, os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../lib'))

import&amp;nbsp;cryptography&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Copy the cryptography package (and its dependencies) into $SPLUNK_HOME/etc/apps/myapp/lib/. Use pip on a compatible system:&lt;/P&gt;&lt;PRE&gt;pip install --target=$SPLUNK_HOME/etc/apps/myapp/lib/cryptography&lt;/PRE&gt;&lt;P&gt;Ensure the Python version used to build the packages matches Splunk's embedded Python (e.g., Python 3.7 or 3.9) on your HF.&lt;/P&gt;&lt;P&gt;You can use the bin directory instead of lib if you prefer, but I've always been advised to use the lib directory. It shouldnt make much difference though.&lt;/P&gt;&lt;P&gt;Check out this page for more info too:&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.4.1/Python3Migration/PythonDevelopment" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/9.4.1/Python3Migration/PythonDevelopment&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt; &lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt; If so, please consider:&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 08 Apr 2025 13:12:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-add-cryptography-or-other-python-lib-to-Splunk-python-own/m-p/743788#M11889</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-04-08T13:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to add cryptography or other python lib to Splunk python own environment for scripted input on HF?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-add-cryptography-or-other-python-lib-to-Splunk-python-own/m-p/744516#M11894</link>
      <description>&lt;P&gt;Two small points:&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. I would avoid the usage of the /lib directory in app code. It was intended to work around an issue that no longer exists (outside of persistent custom REST endpoints) and causes additional issues for extension points that distribute resources to search peers (i.e. certain types of custom search commands and external lookups) - you will need to update .conf files to make sure that the /lib directory is distributed correctly. There are no advantages to using /lib over /bin and /bin is automatically distributed to search peers as required.&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Similarly, the guidance to do import manipulation using sys.path.insert is also outdated, as it does not prevent import collisions within the context of persistent custom REST endpoints).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;e: In the context of a scripted input it shouldn't matter either way. I just want to make sure it's understood where the /lib guidance came from and why it is out of date today.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working to get the old guidance removed from dev.splunk.com and examples on github - appreciate your patience in the meantime.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2025 20:50:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-add-cryptography-or-other-python-lib-to-Splunk-python-own/m-p/744516#M11894</guid>
      <dc:creator>thellmann</dc:creator>
      <dc:date>2025-04-18T20:50:51Z</dc:date>
    </item>
  </channel>
</rss>

