Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import error #161

Open
salihai opened this issue Oct 17, 2023 · 4 comments
Open

import error #161

salihai opened this issue Oct 17, 2023 · 4 comments
Labels
usage General usage

Comments

@salihai
Copy link

salihai commented Oct 17, 2023

How can i solve this problem 'ImportError: cannot import name 'component' from 'spacy' (/usr/local/lib/python3.10/dist-packages/spacy/init.py)' ??

@svlandeg svlandeg added the usage General usage label Oct 18, 2023
@svlandeg
Copy link
Member

Hi! Can you provide more context on what it is you're trying to do? There is no component to be imported from spaCy. Perhaps share your code so I can better understand what's going on?

@salihai
Copy link
Author

salihai commented Oct 18, 2023

Here is my code:

import numpy as np
from sense2vec import Sense2Vec
s2v = Sense2Vec().from_disk('s2v_old')

@svlandeg
Copy link
Member

svlandeg commented Oct 18, 2023

Could it be that your s2v_old model was trained with spaCy v2, and you're now executing this with spaCy v3? spaCy v2 used to have an import for component in the language module.

Unfortunately v2 and v3 aren't compatible. For more background, have a look at our blog post: https://explosion.ai/blog/spacy-v3

With respect to sense2vec:

  • sense2vec 1.x is compatible with spacy 2.x
  • sense2vec 2.x is compatible with spacy 3.x

@salihai
Copy link
Author

salihai commented Oct 18, 2023

i will check it, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usage General usage
Projects
None yet
Development

No branches or pull requests

2 participants