# terms.train-vectors: Error loading Word2Vec from Gensim

**URL:** <https://support.prodi.gy/t/terms-train-vectors-error-loading-word2vec-from-gensim/986>\
**Category:** Uncategorized\
**Tags:** terms, solved, gensim\
**Created:** [November 23, 2018, 1:06pm UTC](https://support.prodi.gy/t/terms-train-vectors-error-loading-word2vec-from-gensim/986 "2018-11-23T13:06:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![henninglebbaeus](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/henninglebbaeus/32/1424_2.png) [@henninglebbaeus](https://support.prodi.gy/u/henninglebbaeus)\
**Post date:** [November 23, 2018, 1:06pm UTC](https://support.prodi.gy/t/terms-train-vectors-error-loading-word2vec-from-gensim/986/1 "2018-11-23T13:06:29Z")

</div>

I try to train a sense2vec model using Prodigy. It seems to have trouble loading Word2Vec from Gensim:

```python
✨ ERROR: Can't load Word2Vec. Make sure you have Gensim
installed: pip install gensim. For more details, see:
https://radimrehurek.com/gensim/

```

**My Environment:**  
Prodigy 1.6.1  
Linux Ubuntu 18.04  
Python 3.6.6  
gensim 3.6.0

I can confirm gensim is installed in the same **virtualenv** as Prodigy.

---

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [November 24, 2018, 12:34pm UTC](https://support.prodi.gy/t/terms-train-vectors-error-loading-word2vec-from-gensim/986/2 "2018-11-24T12:34:37Z")

</div>

That’s strange! All that Prodigy really does here is the following:

```python
try:
    from gensim.models import Word2Vec
except ImportError:
    # raise that error

```

Does this work for you if you import it manually?

Alternatively, you can also just edit the source of `recipes/terms.py`, find `Word2Vec = get_word2vec()` and replac that with a direct call to Gensim’s `Word2Vec`. This might make it a little easier to debug what’s going on?

---

<div class="post-metadata">

**Author:** ![henninglebbaeus](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/henninglebbaeus/32/1424_2.png) [@henninglebbaeus](https://support.prodi.gy/u/henninglebbaeus)\
**Post date:** [November 29, 2018, 12:36pm UTC](https://support.prodi.gy/t/terms-train-vectors-error-loading-word2vec-from-gensim/986/3 "2018-11-29T12:36:24Z")

</div>

@ines: Thanks, but it seems the problem lies with Google Compute Engine and the `boto` package somehow. Found this [thread on Stackoverflow](https://stackoverflow.com/questions/40732313/gensim-installation-problems).

Simple solution:  
`pip install google-compute-engine`

The error message from Prodigy somehow hides the underlying reason from the user. I first only tried to manually import gensim, which worked fine. But running `from gensim.models import Word2Vec` gave me the error that this package is missing.

---

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [November 29, 2018, 12:47pm UTC](https://support.prodi.gy/t/terms-train-vectors-error-loading-word2vec-from-gensim/986/4 "2018-11-29T12:47:36Z")

</div>

Thanks for getting to the bottom of this. This is weird, but good to know!

And yeah, Prodigy does the pretty standard import check, so it’ll capture any `ImportError` raised by the module. I’m not sure if there’s something we can do to prevent this, but we could of course update the error message to include a note like “If you already have Gensim installed, try running from gensim.models import Word2Vec and see what happens” etc.

---

<div class="post-metadata">

**Author:** ![henninglebbaeus](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/henninglebbaeus/32/1424_2.png) [@henninglebbaeus](https://support.prodi.gy/u/henninglebbaeus)\
**Post date:** [November 29, 2018, 2:17pm UTC](https://support.prodi.gy/t/terms-train-vectors-error-loading-word2vec-from-gensim/986/5 "2018-11-29T14:17:23Z")

</div>

I guess now that the problem + solution is here, people should be able to find 😉
