Skip to content

Error when importing Word2Vec within "Training a Word Embeddings Model"T #3

@hleegwater

Description

@hleegwater

Hi! Thanks for making your course materials publicly accessible, it is awesome!

I had a package-related problem when following the tutorial. It is not caused by your code, but it may be nice to know for when you teach the next workshop.

When running a part of the section Training a Word Embeddings Model, more specificially in this line:

from gensim.models import Word2Vec

I got the error:

ImportError: cannot import name 'triu' from 'scipy.linalg'

I traced it back to this function triu being deprecated in my scipy version. Installing a version lower than 1.13 fixed the issue, but is not ideal (https://stackoverflow.com/questions/78279136/importerror-cannot-import-name-triu-from-scipy-linalg-when-importing-gens).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions