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

How to Solve >>> import nltk >>> nltk.download('stopwords') Issue #1

Open
criticalmiind opened this issue Jun 13, 2022 · 2 comments
Open

Comments

@criticalmiind
Copy link

You can now view your Streamlit app in your browser.

Local URL: http://localhost:8501
Network URL: http://192.168.10.7:8501

2022-06-13 13:08:59.134 Uncaught app exception
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/corpus/util.py", line 84, in __load
root = nltk.data.find(f"{self.subdir}/{zip_name}")
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/data.py", line 583, in find
raise LookupError(resource_not_found)
LookupError:


Resource stopwords not found.
Please use the NLTK Downloader to obtain the resource:

import nltk
nltk.download('stopwords')

For more information see: https://www.nltk.org/data.html

Attempted to load corpora/stopwords.zip/stopwords/

Searched in:
- '/Users/apple-pentester/nltk_data'
- '/Library/Frameworks/Python.framework/Versions/3.8/nltk_data'
- '/Library/Frameworks/Python.framework/Versions/3.8/share/nltk_data'
- '/Library/Frameworks/Python.framework/Versions/3.8/lib/nltk_data'
- '/usr/share/nltk_data'
- '/usr/local/share/nltk_data'
- '/usr/lib/nltk_data'
- '/usr/local/lib/nltk_data'


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/apple-pentester/Library/Python/3.8/lib/python/site-packages/streamlit/scriptrunner/script_runner.py", line 554, in _run_script
exec(code, module.dict)
File "/Users/apple-pentester/Desktop/CarParking/Smart_Resume_Analyser_App/App.py", line 5, in
from pyresparser import ResumeParser
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyresparser/init.py", line 1, in
from . import utils
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyresparser/utils.py", line 11, in
from . import constants as cs
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyresparser/constants.py", line 25, in
STOPWORDS = set(stopwords.words('english'))
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/corpus/util.py", line 121, in getattr
self.__load()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/corpus/util.py", line 86, in __load
raise e
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/corpus/util.py", line 81, in __load
root = nltk.data.find(f"{self.subdir}/{self.__name}")
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/data.py", line 583, in find
raise LookupError(resource_not_found)
LookupError:


Resource stopwords not found.
Please use the NLTK Downloader to obtain the resource:

import nltk
nltk.download('stopwords')

For more information see: https://www.nltk.org/data.html

Attempted to load corpora/stopwords

Searched in:
- '/Users/apple-pentester/nltk_data'
- '/Library/Frameworks/Python.framework/Versions/3.8/nltk_data'
- '/Library/Frameworks/Python.framework/Versions/3.8/share/nltk_data'
- '/Library/Frameworks/Python.framework/Versions/3.8/lib/nltk_data'
- '/usr/share/nltk_data'
- '/usr/local/share/nltk_data'
- '/usr/lib/nltk_data'
- '/usr/local/lib/nltk_data'


2022-06-13 13:09:02.105 Uncaught app exception
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/corpus/util.py", line 84, in __load
root = nltk.data.find(f"{self.subdir}/{zip_name}")
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/data.py", line 583, in find
raise LookupError(resource_not_found)
LookupError:


Resource stopwords not found.
Please use the NLTK Downloader to obtain the resource:

import nltk
nltk.download('stopwords')

For more information see: https://www.nltk.org/data.html

Attempted to load corpora/stopwords.zip/stopwords/

Searched in:
- '/Users/apple-pentester/nltk_data'
- '/Library/Frameworks/Python.framework/Versions/3.8/nltk_data'
- '/Library/Frameworks/Python.framework/Versions/3.8/share/nltk_data'
- '/Library/Frameworks/Python.framework/Versions/3.8/lib/nltk_data'
- '/usr/share/nltk_data'
- '/usr/local/share/nltk_data'
- '/usr/lib/nltk_data'
- '/usr/local/lib/nltk_data'


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/apple-pentester/Library/Python/3.8/lib/python/site-packages/streamlit/scriptrunner/script_runner.py", line 554, in _run_script
exec(code, module.dict)
File "/Users/apple-pentester/Desktop/CarParking/Smart_Resume_Analyser_App/App.py", line 5, in
from pyresparser import ResumeParser
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyresparser/init.py", line 1, in
from . import utils
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyresparser/utils.py", line 11, in
from . import constants as cs
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyresparser/constants.py", line 25, in
STOPWORDS = set(stopwords.words('english'))
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/corpus/util.py", line 121, in getattr
self.__load()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/corpus/util.py", line 86, in __load
raise e
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/corpus/util.py", line 81, in __load
root = nltk.data.find(f"{self.subdir}/{self.__name}")
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/data.py", line 583, in find
raise LookupError(resource_not_found)
LookupError:


Resource stopwords not found.
Please use the NLTK Downloader to obtain the resource:

import nltk
nltk.download('stopwords')

For more information see: https://www.nltk.org/data.html

Attempted to load corpora/stopwords

Searched in:
- '/Users/apple-pentester/nltk_data'
- '/Library/Frameworks/Python.framework/Versions/3.8/nltk_data'
- '/Library/Frameworks/Python.framework/Versions/3.8/share/nltk_data'
- '/Library/Frameworks/Python.framework/Versions/3.8/lib/nltk_data'
- '/usr/share/nltk_data'
- '/usr/local/share/nltk_data'
- '/usr/lib/nltk_data'
- '/usr/local/lib/nltk_data'


@SaduniHettihewa
Copy link

You can now view your Streamlit app in your browser.

Local URL: http://localhost:8501 Network URL: http://192.168.10.7:8501

2022-06-13 13:08:59.134 Uncaught app exception Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/corpus/util.py", line 84, in __load root = nltk.data.find(f"{self.subdir}/{zip_name}") File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/data.py", line 583, in find raise LookupError(resource_not_found) LookupError:

Resource stopwords not found. Please use the NLTK Downloader to obtain the resource:

import nltk
nltk.download('stopwords')

For more information see: https://www.nltk.org/data.html

Attempted to load corpora/stopwords.zip/stopwords/

Searched in: - '/Users/apple-pentester/nltk_data' - '/Library/Frameworks/Python.framework/Versions/3.8/nltk_data' - '/Library/Frameworks/Python.framework/Versions/3.8/share/nltk_data' - '/Library/Frameworks/Python.framework/Versions/3.8/lib/nltk_data' - '/usr/share/nltk_data' - '/usr/local/share/nltk_data' - '/usr/lib/nltk_data' - '/usr/local/lib/nltk_data'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/apple-pentester/Library/Python/3.8/lib/python/site-packages/streamlit/scriptrunner/script_runner.py", line 554, in _run_script exec(code, module.dict) File "/Users/apple-pentester/Desktop/CarParking/Smart_Resume_Analyser_App/App.py", line 5, in from pyresparser import ResumeParser File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyresparser/init.py", line 1, in from . import utils File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyresparser/utils.py", line 11, in from . import constants as cs File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyresparser/constants.py", line 25, in STOPWORDS = set(stopwords.words('english')) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/corpus/util.py", line 121, in getattr self.__load() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/corpus/util.py", line 86, in __load raise e File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/corpus/util.py", line 81, in __load root = nltk.data.find(f"{self.subdir}/{self.__name}") File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/data.py", line 583, in find raise LookupError(resource_not_found) LookupError:

Resource stopwords not found. Please use the NLTK Downloader to obtain the resource:

import nltk
nltk.download('stopwords')

For more information see: https://www.nltk.org/data.html

Attempted to load corpora/stopwords

Searched in: - '/Users/apple-pentester/nltk_data' - '/Library/Frameworks/Python.framework/Versions/3.8/nltk_data' - '/Library/Frameworks/Python.framework/Versions/3.8/share/nltk_data' - '/Library/Frameworks/Python.framework/Versions/3.8/lib/nltk_data' - '/usr/share/nltk_data' - '/usr/local/share/nltk_data' - '/usr/lib/nltk_data' - '/usr/local/lib/nltk_data'

2022-06-13 13:09:02.105 Uncaught app exception Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/corpus/util.py", line 84, in __load root = nltk.data.find(f"{self.subdir}/{zip_name}") File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/data.py", line 583, in find raise LookupError(resource_not_found) LookupError:

Resource stopwords not found. Please use the NLTK Downloader to obtain the resource:

import nltk
nltk.download('stopwords')

For more information see: https://www.nltk.org/data.html

Attempted to load corpora/stopwords.zip/stopwords/

Searched in: - '/Users/apple-pentester/nltk_data' - '/Library/Frameworks/Python.framework/Versions/3.8/nltk_data' - '/Library/Frameworks/Python.framework/Versions/3.8/share/nltk_data' - '/Library/Frameworks/Python.framework/Versions/3.8/lib/nltk_data' - '/usr/share/nltk_data' - '/usr/local/share/nltk_data' - '/usr/lib/nltk_data' - '/usr/local/lib/nltk_data'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/apple-pentester/Library/Python/3.8/lib/python/site-packages/streamlit/scriptrunner/script_runner.py", line 554, in _run_script exec(code, module.dict) File "/Users/apple-pentester/Desktop/CarParking/Smart_Resume_Analyser_App/App.py", line 5, in from pyresparser import ResumeParser File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyresparser/init.py", line 1, in from . import utils File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyresparser/utils.py", line 11, in from . import constants as cs File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyresparser/constants.py", line 25, in STOPWORDS = set(stopwords.words('english')) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/corpus/util.py", line 121, in getattr self.__load() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/corpus/util.py", line 86, in __load raise e File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/corpus/util.py", line 81, in __load root = nltk.data.find(f"{self.subdir}/{self.__name}") File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/data.py", line 583, in find raise LookupError(resource_not_found) LookupError:

Resource stopwords not found. Please use the NLTK Downloader to obtain the resource:

import nltk
nltk.download('stopwords')

For more information see: https://www.nltk.org/data.html

Attempted to load corpora/stopwords

Searched in: - '/Users/apple-pentester/nltk_data' - '/Library/Frameworks/Python.framework/Versions/3.8/nltk_data' - '/Library/Frameworks/Python.framework/Versions/3.8/share/nltk_data' - '/Library/Frameworks/Python.framework/Versions/3.8/lib/nltk_data' - '/usr/share/nltk_data' - '/usr/local/share/nltk_data' - '/usr/lib/nltk_data' - '/usr/local/lib/nltk_data'

python -m nltk.downloader all
This command was work for me. Download the nltk (Natural Language Toolkit) all.

nltk

@WillianBR
Copy link

You can now view your Streamlit app in your browser.

Local URL: http://localhost:8501 Network URL: http://192.168.10.7:8501

2022-06-13 13:08:59.134 Uncaught app exception Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/corpus/util.py", line 84, in __load root = nltk.data.find(f"{self.subdir}/{zip_name}") File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nltk/data.py", line 583, in find raise LookupError(resource_not_found) LookupError:

Resource stopwords not found. Please use the NLTK Downloader to obtain the resource:

import nltk
nltk.download('stopwords')

For more information see: https://www.nltk.org/data.html

Attempted to load corpora/stopwords.zip/stopwords/
...

Hi @criticalmiind,

I solved the issue just running a small command:

python -c "import nltk; nltk.download('stopwords')"

As I created a venv to run the project, I just ran the above command inside the venv previously activated!

It's solved the issue!

I'm going to the next one!

As they once said:

Just take one Lion at time!

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

No branches or pull requests

3 participants