All Apps and Add-ons

Splunk installing pandas -Ubuntu 18.0.4

giatuanh
Engager

I have a problem with running python on the Linux environment, where I try to appoint splunk's python to recognize another path for site-packages, where I can pip install ... but for some reason I have recalled with some other errors too.

I know I can use Splunk_SA_Scientific_Python_linux_x86_64 to bypass issues pandas and numpy but I ran into problems with requests like ImportError: No module named ssl_ OR 'NoneType' object has no attribute 'wrap_socket'

Therefore, I force to set splunk's python to recognize another path follow by this article: https://answers.splunk.com/answers/484369/how-can-i-add-python-modules-to-the-splunk-environ-1.html

But I am running to this error: Original error was: /usr/local/lib/python2.7/dist-packages/numpy/core/_multiarray_umath.so: undefined symbol: PyUnicodeUCS4_FromObject

import sys
sys.path.append('/usr/bin/python2.7')
sys.path.append('/usr/local/lib/python2.7/dist-packages')

import numpy as np
import pandas as pd 
import bs4
import lxml
import requests 
0 Karma

badarsebard
Communicator

Typically there are more packages than what's in the dist-packages, or even what's in the python2.7 directory. In order to do what you're trying to achieve this way you'd need to find all of those locations and add them to your sys.path.

What might be a better approach is to look at using the PyDen app: https://splunkbase.splunk.com/app/4322/. This app (and it's companion PyDen Manager) will allow you to create Python virtual environments of any version you can compile on your system (including version 3.5+) that can be used inside of Splunk. The app comes with a pip tool that will allow you to install and PyPI package to a specific virtual environment and there are examples scripts of how to activate the virtual environments from your Python scripts.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...

Customer success is front and center at .conf25

Hi Splunkers, If you are not able to be at .conf25 in person, you can still learn about all the latest news ...

.conf25 Global Broadcast: Don’t Miss a Moment

Hello Splunkers, .conf25 is only a click away.  Not able to make it to .conf25 in person? No worries, you can ...