Error installing Opennyai Pipeline

I tired installing Opennayi Pipeline available at GitHub - OpenNyAI/Opennyai: Opennyai : An efficient NLP Pipeline for Indian Legal documents, however got the following error. Please help me out in resolving this (if possible)

Error:
--------------------------------------------Error Starts -----------------------------------------
(opennyai) PS C:\Users\Dell> pip install -U opennyai
Collecting opennyai
Using cached opennyai-0.0.10-py3-none-any.whl (168 kB)
INFO: pip is looking at multiple versions of opennyai to determine which version is compatible with other requirements. This could take a while.
Using cached opennyai-0.0.9-py3-none-any.whl (163 kB)
ERROR: Cannot install opennyai==0.0.10 and opennyai==0.0.9 because these package versions have conflicting dependencies.

The conflict is caused by:
opennyai 0.0.10 depends on torch<1.13.0 and >=1.10.0
opennyai 0.0.9 depends on torch<1.13.0 and >=1.10.0

To fix this you could try to:

  1. loosen the range of package versions you’ve specified
  2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit Dependency Resolution - pip documentation v23.3.dev0
---------------------------------------------- Error Ends -----------------------------------------

Please try creating a new virtual env and then try installing. Also python version should be 3.8.

I’ve moved this conversation to the right Topic.

@sahmed31 Did this work for you?

Thanks for the help @Prathamesh and @varun using conda the environment is not setup. However, we have a new issue now. Looks like some library issue:

Python Code:
from opennyai import Pipeline

Issue output:
Python 3.8.17 (default, Jul 5 2023, 20:44:21) [MSC v.1916 64 bit (AMD64)]
Type “copyright”, “credits” or “license” for more information.

IPython 8.12.0 – An enhanced Interactive Python.

runfile(‘C:/Users/Dell/.spyder-py3/temp.py’, wdir=‘C:/Users/Dell/.spyder-py3’)
C:\Users\Dell\anaconda3\envs\opennyai\lib\site-packages\tqdm\auto.py:22: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See Installation — Jupyter Widgets 8.1.0 documentation
from .autonotebook import tqdm as notebook_tqdm
Traceback (most recent call last):

File ~\anaconda3\envs\opennyai\lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
exec(code, globals, locals)

File c:\users\dell.spyder-py3\temp.py:7
from opennyai import Pipeline

File ~\anaconda3\envs\opennyai\lib\site-packages\opennyai_init_.py:1
from opennyai import ner, utils

File ~\anaconda3\envs\opennyai\lib\site-packages\opennyai\ner_init_.py:1
from .ner_utils import load, get_json_from_spacy_doc, ner_displacy_option, get_csv, get_unique_precedent_count, \

File ~\anaconda3\envs\opennyai\lib\site-packages\opennyai\ner\ner_utils.py:6
from opennyai.ner.InLegalNER.InLegalNER import InLegalNER

File ~\anaconda3\envs\opennyai\lib\site-packages\opennyai\ner\InLegalNER\InLegalNER.py:3
import spacy

File ~\anaconda3\envs\opennyai\lib\site-packages\spacy_init_.py:14
from . import pipeline # noqa: F401

File ~\anaconda3\envs\opennyai\lib\site-packages\spacy\pipeline_init_.py:1
from .attributeruler import AttributeRuler

File ~\anaconda3\envs\opennyai\lib\site-packages\spacy\pipeline\attributeruler.py:6
from .pipe import Pipe

File spacy\pipeline\pipe.pyx:8 in init spacy.pipeline.pipe

File ~\anaconda3\envs\opennyai\lib\site-packages\spacy\training_init_.py:11
from .callbacks import create_copy_from_base_model # noqa: F401

File ~\anaconda3\envs\opennyai\lib\site-packages\spacy\training\callbacks.py:3
from …language import Language

File ~\anaconda3\envs\opennyai\lib\site-packages\spacy\language.py:25
from .training.initialize import init_vocab, init_tok2vec

File ~\anaconda3\envs\opennyai\lib\site-packages\spacy\training\initialize.py:14
from .pretrain import get_tok2vec_ref

File ~\anaconda3\envs\opennyai\lib\site-packages\spacy\training\pretrain.py:16
from …schemas import ConfigSchemaPretrain

File ~\anaconda3\envs\opennyai\lib\site-packages\spacy\schemas.py:216
class TokenPattern(BaseModel):

File pydantic\main.py:299 in pydantic.main.ModelMetaclass.new

File pydantic\fields.py:411 in pydantic.fields.ModelField.infer

File pydantic\fields.py:342 in pydantic.fields.ModelField.init

File pydantic\fields.py:451 in pydantic.fields.ModelField.prepare

File pydantic\fields.py:545 in pydantic.fields.ModelField._type_analysis

File pydantic\fields.py:550 in pydantic.fields.ModelField._type_analysis

File ~\anaconda3\envs\opennyai\lib\typing.py:774 in subclasscheck
return issubclass(cls, self.origin)

TypeError: issubclass() arg 1 must be a class

We have fixed this and created a new release. Please try with latest version 0.0.11

Thanks @Prathamesh. The NLP Pipeline is working now.

1 Like

Dear @Prathamesh,

While installing the Opennyai NLP for one of our students we are getting an error:

pip install -U opennyai

error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools”: Microsoft C++ Build Tools - Visual Studio
[end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for thinc
  Failed to build thinc
  ERROR: Could not build wheels for thinc, which is required to install pyproject.toml-based projects
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

It would be helpful in case this can be resolved.

Regards
Sayyed