Knowledge Management

ImportError: No module named site when training own data with Sentiment Analysis App

jebssantos
New Member

I'm trying to create a model based on my own data using the Sentiment Analysis App. Apparently there isn't much documentation out there to help me.

I have a collection of tweets about various products that I want to use as training data for classifying each tweet based on what product the tweet is talking about.

But I keep on getting the "ImportError: No module named site" every time I try to train.

I am running on Windows 10 by the way.

alt text

0 Karma

hardikJsheth
Motivator

From the error, it looks like you are trying to import a package that's not bundled with Splunk's python. In case you want to use any external package, you need to put that package within your bin folder and also add appropriate reference to path variable from your script. i.e if you want to refer to python files within lib folder of your app you can use following code

sys.path.append(make_splunkhome_path(["etc", "apps", "training_app", "bin", "lib"]))
0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...