You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
I encountered an error while trying to import Spacy after installing it using the following command:
RUN python3 -m pip install -U 'spacy[cuda110,transformers,lookups]'
The error occurs at the line import spacy in my code, and the traceback shows the following error message:
File "/pipelines/component/src/spacy_ner.py", line 7, in
import spacy
...
TypeError: issubclass() arg 1 must be a class
FullTraceBack: But getting below error while in "import spacy "
File "/pipelines/component/src/spacy_ner.py", line 7, in
import spacy
File "/usr/local/lib/python3.8/dist-packages/spacy/init.py", line 14, in
from . import pipeline # noqa: F401
File "/usr/local/lib/python3.8/dist-packages/spacy/pipeline/init.py", line 1, in
from .attributeruler import AttributeRuler
File "/usr/local/lib/python3.8/dist-packages/spacy/pipeline/attributeruler.py", line 6, in
from .pipe import Pipe
File "spacy/pipeline/pipe.pyx", line 1, in init spacy.pipeline.pipe
File "spacy/vocab.pyx", line 1, in init spacy.vocab
File "/usr/local/lib/python3.8/dist-packages/spacy/tokens/init.py", line 1, in
from .doc import Doc
File "spacy/tokens/doc.pyx", line 36, in init spacy.tokens.doc
File "/usr/local/lib/python3.8/dist-packages/spacy/schemas.py", line 250, in
class TokenPattern(BaseModel):
File "pydantic/main.py", line 205, in pydantic.main.ModelMetaclass.new
File "pydantic/fields.py", line 491, in pydantic.fields.ModelField.infer
File "pydantic/fields.py", line 421, in pydantic.fields.ModelField.init
File "pydantic/fields.py", line 537, in pydantic.fields.ModelField.prepare
File "pydantic/fields.py", line 634, in pydantic.fields.ModelField._type_analysis
File "pydantic/fields.py", line 641, in pydantic.fields.ModelField._type_analysis
File "/usr/lib/python3.8/typing.py", line 774, in subclasscheck
return issubclass(cls, self.origin)
TypeError: issubclass() arg 1 must be a class
I believe this issue is related to the typing extension version in the repository. It seems that the correct version of typing-extension for this setup should be 4.5.0.
To reproduce the issue, please follow these steps:
Install Spacy using the command mentioned above.
Attempt to import Spacy in your code.
I kindly request updating the repository with the correct typing-extension version (4.5.0) to resolve this issue. Thank you for your attention to this matter.
The text was updated successfully, but these errors were encountered:
Description:
I encountered an error while trying to import Spacy after installing it using the following command:
RUN python3 -m pip install -U 'spacy[cuda110,transformers,lookups]'
The error occurs at the line import spacy in my code, and the traceback shows the following error message:
File "/pipelines/component/src/spacy_ner.py", line 7, in
import spacy
...
TypeError: issubclass() arg 1 must be a class
Full TraceBack:
But getting below error while in "import spacy "
File "/pipelines/component/src/spacy_ner.py", line 7, in
import spacy
File "/usr/local/lib/python3.8/dist-packages/spacy/init.py", line 14, in
from . import pipeline # noqa: F401
File "/usr/local/lib/python3.8/dist-packages/spacy/pipeline/init.py", line 1, in
from .attributeruler import AttributeRuler
File "/usr/local/lib/python3.8/dist-packages/spacy/pipeline/attributeruler.py", line 6, in
from .pipe import Pipe
File "spacy/pipeline/pipe.pyx", line 1, in init spacy.pipeline.pipe
File "spacy/vocab.pyx", line 1, in init spacy.vocab
File "/usr/local/lib/python3.8/dist-packages/spacy/tokens/init.py", line 1, in
from .doc import Doc
File "spacy/tokens/doc.pyx", line 36, in init spacy.tokens.doc
File "/usr/local/lib/python3.8/dist-packages/spacy/schemas.py", line 250, in
class TokenPattern(BaseModel):
File "pydantic/main.py", line 205, in pydantic.main.ModelMetaclass.new
File "pydantic/fields.py", line 491, in pydantic.fields.ModelField.infer
File "pydantic/fields.py", line 421, in pydantic.fields.ModelField.init
File "pydantic/fields.py", line 537, in pydantic.fields.ModelField.prepare
File "pydantic/fields.py", line 634, in pydantic.fields.ModelField._type_analysis
File "pydantic/fields.py", line 641, in pydantic.fields.ModelField._type_analysis
File "/usr/lib/python3.8/typing.py", line 774, in subclasscheck
return issubclass(cls, self.origin)
TypeError: issubclass() arg 1 must be a class
I believe this issue is related to the typing extension version in the repository. It seems that the correct version of typing-extension for this setup should be 4.5.0.
To reproduce the issue, please follow these steps:
Install Spacy using the command mentioned above.
Attempt to import Spacy in your code.
I kindly request updating the repository with the correct typing-extension version (4.5.0) to resolve this issue. Thank you for your attention to this matter.
The text was updated successfully, but these errors were encountered: