AnasAito / SkillNER

A (smart) rule based NLP module to extract job skills from text
https://skillner.vercel.app/
MIT License
154 stars 52 forks source link

BUG - unable to import ``skillner`` in a newly created python environment #51

Closed scottbarnesg closed 1 year ago

scottbarnesg commented 2 years ago

Describe the bug IPython is listed in requirements.txt but not setup.py. This causes import errors when installing skillNer via pip.

To Reproduce Install skillNER and spacy

python -m pip install skillNER spacy
python -m spacy download en_core_web_lg

Import SkillExtractor

>>> from skillNer.skill_extractor_class import SkillExtractor

which produces the following exception:

Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/code.py", line 90, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
  File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "/Users/scottgbarnes/venvs/personifi-etl/lib/python3.10/site-packages/skillNer/skill_extractor_class.py", line 11, in <module>
    from skillNer.visualizer.html_elements import DOM, render_phrase
  File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "/Users/scottgbarnes/venvs/personifi-etl/lib/python3.10/site-packages/skillNer/visualizer/html_elements.py", line 5, in <module>
    from IPython.core.display import HTML
  File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'IPython'

Expected behavior Should import without error.

Screenshots N/A

Desktop (please complete the following information):

Smartphone (please complete the following information): N/A

Additional context Installing IPython manually fixes this issue, but dependencies should be handled within the skillNER package. Generally, your requirements.txt and setup.py dependencies list should be identical.

Badr-MOUFAD commented 1 year ago

Hi @scottbarnesg! Thanks for reporting this bug. Do you mind making a pull request to add ipython to the dependencies in setup.py file?

scottbarnesg commented 1 year ago

Sure, I'll put the changes together tomorrow.