You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@zeppelin.apache.org by Chad Roberts <cr...@redhat.com> on 2015/09/09 17:19:15 UTC

Problem running Twitter streaming example

When attempting to run the Twitter streaming example from
https://zeppelin.incubator.apache.org/docs/tutorial/tutorial.html I am
seeing the following error.  Can anyone help me figure it out?

import org.apache.spark.streaming._ <console>:30: error: object twitter is
not a member of package org.apache.spark.streaming import
org.apache.spark.streaming.twitter._

I am using spark 1.3.1 and the tip of zeppelin master (as of yesterday) in
case that makes a difference.

Thanks,
Chad

Re: Problem running Twitter streaming example

Posted by Chad Roberts <cr...@redhat.com>.
Thanks,

I did indeed find that %dep fixed my problem.  Great feature.

Just in case anyone else encounters my situation, here is my full %dep
paragraph that I used to make the example work.  (I switched to use Spark
1.4.1 after I posted here, hence the 1.4.1 version on my
spark-streaming-twitter).

%dep
z.load("org.apache.spark:spark-streaming-twitter_2.10:1.4.1")
z.load("org.twitter4j:twitter4j-core:3.0.3")
z.load("org.twitter4j:twitter4j-media-support:3.0.3")
z.load("org.twitter4j:twitter4j-async:3.0.3")
z.load("org.twitter4j:twitter4j-examples:3.0.3")
z.load("org.twitter4j:twitter4j-stream:3.0.3")

On Wed, Sep 16, 2015 at 1:06 AM, moon soo Lee <mo...@apache.org> wrote:

> Hi Chad,
>
> You can use %dep (
> http://zeppelin.incubator.apache.org/docs/interpreter/spark.html#dependencyloading)
> to load missing library.
>
> %dep
> z.reset
> z.load("org.apache.spark:spark-streaming-twitter_2.10:1.3.1")
>
> %spark
> import org.apache.spark.streaming._
> import org.apache.spark.streaming.twitter._
> ....
>
>
> Hope this helps.
>
> Thanks,
> moon
>
>
> On Thu, Sep 10, 2015 at 12:19 AM Chad Roberts <cr...@redhat.com> wrote:
>
>> When attempting to run the Twitter streaming example from
>> https://zeppelin.incubator.apache.org/docs/tutorial/tutorial.html I am
>> seeing the following error.  Can anyone help me figure it out?
>>
>> import org.apache.spark.streaming._ <console>:30: error: object twitter
>> is not a member of package org.apache.spark.streaming import
>> org.apache.spark.streaming.twitter._
>>
>> I am using spark 1.3.1 and the tip of zeppelin master (as of yesterday)
>> in case that makes a difference.
>>
>> Thanks,
>> Chad
>>
>

Re: Problem running Twitter streaming example

Posted by moon soo Lee <mo...@apache.org>.
Hi Chad,

You can use %dep (
http://zeppelin.incubator.apache.org/docs/interpreter/spark.html#dependencyloading)
to load missing library.

%dep
z.reset
z.load("org.apache.spark:spark-streaming-twitter_2.10:1.3.1")

%spark
import org.apache.spark.streaming._
import org.apache.spark.streaming.twitter._
....


Hope this helps.

Thanks,
moon


On Thu, Sep 10, 2015 at 12:19 AM Chad Roberts <cr...@redhat.com> wrote:

> When attempting to run the Twitter streaming example from
> https://zeppelin.incubator.apache.org/docs/tutorial/tutorial.html I am
> seeing the following error.  Can anyone help me figure it out?
>
> import org.apache.spark.streaming._ <console>:30: error: object twitter is
> not a member of package org.apache.spark.streaming import
> org.apache.spark.streaming.twitter._
>
> I am using spark 1.3.1 and the tip of zeppelin master (as of yesterday) in
> case that makes a difference.
>
> Thanks,
> Chad
>