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

NLTK package missing #7

Closed
nufaylr opened this issue Nov 2, 2020 · 3 comments
Closed

NLTK package missing #7

nufaylr opened this issue Nov 2, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@nufaylr
Copy link

nufaylr commented Nov 2, 2020

Hi there, I was exploring the library. Trying to install it via pip with conda env. and I'm getting ModuleNotFoundError

ModuleNotFoundError: No module named 'nltk'

version : sinling 0.3.5
environment : conda
os : BSD

Thank you for the library 👍

@ysenarath
Copy link
Owner

ysenarath commented Nov 2, 2020

Hi,

I'm unable to replicate the issue with my setup. Can you try installing nltk using pip before installing sinling? You can use following command

pip install nltk

However, the package does not require you to install nltk as a base package for it to work. If the above does not work for you, you might want to clone this repository and add the path to the cloned repository to PYTHONPATH env variable.

Let me know how it goes.

@nufaylr
Copy link
Author

nufaylr commented Nov 3, 2020

Hi, Thank you for your prompt replying.

Yes 👍 it worked once i install nltk.

I was trying to reproduce by doing a fresh installation. This what I get when I run an examples

test_1.py

from sinling import preprocess, word_joiner
w1 = preprocess('මුනි')
w2 = preprocess('උතුමා')
results = word_joiner.join(w1, w2)
print(results)

This the error I get

  File "test_1.py", line 1, in <module>
    from sinling import preprocess, word_joiner
  File "/usr/local/Caskroom/miniconda/base/envs/py38-sinling/lib/python3.8/site-packages/sinling/__init__.py", line 1, in <module>
    from sinling.sinhala import *
  File "/usr/local/Caskroom/miniconda/base/envs/py38-sinling/lib/python3.8/site-packages/sinling/sinhala/__init__.py", line 3, in <module>
    from sinling.sinhala.splitter import *
  File "/usr/local/Caskroom/miniconda/base/envs/py38-sinling/lib/python3.8/site-packages/sinling/sinhala/splitter.py", line 62, in <module>
    word_splitter = CorpusBasedSplitter(_data_path)
  File "/usr/local/Caskroom/miniconda/base/envs/py38-sinling/lib/python3.8/site-packages/sinling/sinhala/splitter.py", line 23, in __init__
    self.data = pickle.load(file)
ModuleNotFoundError: No module named 'nltk'

Dose Pickle module using nltk as dependency again i can see its under nltk is under requirements.txt

maybe its conda issue :) it might needs its own channel to install.

@ysenarath
Copy link
Owner

Thank you for providing the error. Yes, it seems that I used a nltk package in the pickled resource. It is not a problem of conda, just current version is not configured to automatically install nltk when installing via pip. I'll update the configurations to fix the issue.

P.S. All packages that will be automatically installed when installing the package are listed in this file.

@ysenarath ysenarath self-assigned this Nov 4, 2020
@ysenarath ysenarath added the bug Something isn't working label Nov 4, 2020
@ysenarath ysenarath added this to To do in Project Tasks Nov 4, 2020
@ysenarath ysenarath moved this from To do to In progress in Project Tasks Nov 8, 2020
@ysenarath ysenarath moved this from In progress to Done in Project Tasks Nov 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Project Tasks
  
Done
Development

No branches or pull requests

2 participants