# Error creating Hail Context

**URL:** <https://discuss.hail.is/t/error-creating-hail-context/503>\
**Category:** Help \[0.1\]\
**Created:** [May 16, 2018, 3:07pm UTC](https://discuss.hail.is/t/error-creating-hail-context/503 "2018-05-16T15:07:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruth\_Mitchell](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@Ruth\_Mitchell](https://discuss.hail.is/u/Ruth_Mitchell)\
**Post date:** [May 16, 2018, 3:07pm UTC](https://discuss.hail.is/t/error-creating-hail-context/503/1 "2018-05-16T15:07:43Z")

</div>

I’m having trouble creating a HailContext. We’ve installed hail and its dependencies (Java, spark and python - can I double check which version of python is needed as the website say 2 yet the installation docs specify python 3?).

It happily imports hail but then gives me this error when I try creating a HailContext:

In [2]: from hail import \*

## In [3]: hc = HailContext

NameError Traceback (most recent call last)  
 in ()  
----\> 1 hc = HailContext  
NameError: name ‘HailContext’ is not defined

Do you know what might be going on?

Many thanks!

Ruth

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [May 16, 2018, 3:10pm UTC](https://discuss.hail.is/t/error-creating-hail-context/503/2 "2018-05-16T15:10:22Z")

</div>

Hi Ruth,  
This sounds like a Hail version issue. There are currently two versions of Hail people are using –

0.1: the stable version released about a year ago.  
[https://www.hail.is/docs/stable](https://www.hail.is/docs/stable)

0.2: the development version that has been in open beta for a few months  
[https://www.hail.is/docs/devel](https://www.hail.is/docs/devel)

We’re recommending that all new users start with 0.2 – it’s _significantly_ better than 0.1 in many ways.

`HailContext` was an important part of 0.1, but it’s been removed in 0.2. I think you have 0.2 installed (which is good!).

---

<div class="post-metadata">

**Author:** ![Ruth\_Mitchell](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@Ruth\_Mitchell](https://discuss.hail.is/u/Ruth_Mitchell)\
**Post date:** [May 16, 2018, 3:33pm UTC](https://discuss.hail.is/t/error-creating-hail-context/503/3 "2018-05-16T15:33:42Z")

</div>

Thank so much Tim! You are very correct! The kind folk at HPC services installed it for me and they obviously installed the right one but not the one I thought they were installing!

It is now happier but with hl.init() it gives me this error:  
‘TypeError: ‘JavaPackage’ object is not callable’

Is this something to do with the hail-all-spark.jar? as I can’t find that within the installation and the only thing in /libs is this: genomicsdb-0.6.4.jar  
I’m double checking with HPC folk about this.

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [May 16, 2018, 3:36pm UTC](https://discuss.hail.is/t/error-creating-hail-context/503/4 "2018-05-16T15:36:36Z")

</div>

Yes, exactly right. That error message means that Hail’s Python lib can’t find the JAR.

What configuration have you set? In particular, the section here should help:  
[https://hail.is/docs/devel/getting\_started.html#running-on-a-spark-cluster](https://hail.is/docs/devel/getting_started.html#running-on-a-spark-cluster)

If you’re missing the `extraClassPath` stuff, I’d expect a message like this.

---

<div class="post-metadata">

**Author:** ![Ruth\_Mitchell](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@Ruth\_Mitchell](https://discuss.hail.is/u/Ruth_Mitchell)\
**Post date:** [May 16, 2018, 3:47pm UTC](https://discuss.hail.is/t/error-creating-hail-context/503/5 "2018-05-16T15:47:08Z")

</div>

Yeah, I haven’t been able to set the extraClassPath stuff as the JAR file doesn’t exist.  
I’ve tried to generate with:  
./gradlew -Dspark.version=2.2.0 shadowJar archiveZip  
but it doesn’t have a git repository  
(‘fatal: Not a git repository (or any parent up to mount point /mnt/storage)  
Stopping at filesystem boundary (GIT\_DISCOVERY\_ACROSS\_FILESYSTEM not set).’) and this is not something I can create so I’ll go back to the guy who kindly installed it. Unless there is another round it?

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [May 16, 2018, 3:48pm UTC](https://discuss.hail.is/t/error-creating-hail-context/503/6 "2018-05-16T15:48:57Z")

</div>

you shouldn’t need to recompile – you can download the distributions with the jar / python zip from here:  
[https://hail.is/docs/devel/getting\_started.html#running-hail-locally-with-a-pre-compiled-distribution](https://hail.is/docs/devel/getting_started.html#running-hail-locally-with-a-pre-compiled-distribution)

Then you unzip, put the jar somewhere, and do the setup yourself, I think.

---

<div class="post-metadata">

**Author:** ![Ruth\_Mitchell](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@Ruth\_Mitchell](https://discuss.hail.is/u/Ruth_Mitchell)\
**Post date:** [May 16, 2018, 4:05pm UTC](https://discuss.hail.is/t/error-creating-hail-context/503/7 "2018-05-16T16:05:20Z")

</div>

Yep, that’s worked - thank you!!
