Getting Data In
Highlighted

Error when setting Splunk version 8.0.3 to Python 3: "No module named 'OpenSSL'".

New Member

We have a custom python REST endpoint that uses the OpenSSL module for some crypto functions. Works fine when we run Splunk with the Python version set to Python 2 but fails with a No module named 'OpenSSL' error when we set the version to Python 3. So it looks like the OpenSSL module is not included in Splunk's Python 3? Am I missing something? Are there any plans to add that?

Labels (1)
0 Karma
Highlighted

Re: Error when setting Splunk version 8.0.3 to Python 3: "No module named 'OpenSSL'".

Communicator

sounds simple but have you tried the below

pip install pyOpenSSL --upgrade
0 Karma
Highlighted

Re: Error when setting Splunk version 8.0.3 to Python 3: "No module named 'OpenSSL'".

New Member

Well that would upgrade it on the OS, but the python code in Splunk apps run in Splunk's separate python environment. The other issue is that we're building an app that gets installed in customers' environments, not our own Splunk environment where we could just add/upgrade the python modules.

It's just strange that Splunk would include OpenSSL in their python2 environment but not their python3 environment. Especially since they will be ending support for python2 altogether in July.

0 Karma
Highlighted

Re: Error when setting Splunk version 8.0.3 to Python 3: "No module named 'OpenSSL'".

Motivator

Hello @qtieu

you can include all dependencies (pyOpenSSL etc.) in your app in the lib folder.

0 Karma
Highlighted

Re: Error when setting Splunk version 8.0.3 to Python 3: "No module named 'OpenSSL'".

New Member

Yes I could do that. But (as you may already be aware) the thing about OpenSSL and other crypto libraries is that they're usually just a thin Python wrapper calling some native C code so the Python packages also include some platform-dependent libraries. So including those would make our app platform-specific rather than just letting Splunk itself deal with the platform-specific things.

0 Karma
Highlighted

Re: Error when setting Splunk version 8.0.3 to Python 3: "No module named 'OpenSSL'".

Observer

I can't find a good example on how to do this, also wouldn't this require installing pyOpenSSL on the python3 included in Splunk?  I think there is more to it than a simple lib reference, but if you have an example that would be great

0 Karma
Speak Up for Splunk Careers!

We want to better understand the impact Splunk experience and expertise has has on individuals' careers, and help highlight the growing demand for Splunk skills.