petermr / openDiagram

Extaction of semantic data from diagrams in scientific and other technical/business documents
Apache License 2.0
1 stars 5 forks source link

Unable to run `search_lib.py` file #1

Open Radhu903 opened 3 years ago

Radhu903 commented 3 years ago
C:\ProgramData\Anaconda3\python.exe C:/Users/DELL/Radhu/openDiagram/physchem/python/search_lib.py
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\nltk\corpus\util.py", line 86, in __load
    root = nltk.data.find('{}/{}'.format(self.subdir, zip_name))
  File "C:\ProgramData\Anaconda3\lib\site-packages\nltk\data.py", line 699, 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')

  Attempted to load corpora/stopwords.zip/stopwords/

  Searched in:
    - 'C:\\Users\\DELL/nltk_data'
    - 'C:\\ProgramData\\Anaconda3\\nltk_data'
    - 'C:\\ProgramData\\Anaconda3\\share\\nltk_data'
    - 'C:\\ProgramData\\Anaconda3\\lib\\nltk_data'
    - 'C:\\Users\\DELL\\AppData\\Roaming\\nltk_data'
    - 'C:\\nltk_data'
    - 'D:\\nltk_data'
    - 'E:\\nltk_data'
**********************************************************************

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Users/DELL/Radhu/openDiagram/physchem/python/search_lib.py", line 6, in <module>
    from text_lib import TextUtil
  File "C:\Users\DELL\Radhu\openDiagram\physchem\python\text_lib.py", line 41, in <module>
    STOPWORDS_EN = nltk.corpus.stopwords.words("english")
  File "C:\ProgramData\Anaconda3\lib\site-packages\nltk\corpus\util.py", line 123, in __getattr__
    self.__load()
  File "C:\ProgramData\Anaconda3\lib\site-packages\nltk\corpus\util.py", line 88, in __load
    raise e
  File "C:\ProgramData\Anaconda3\lib\site-packages\nltk\corpus\util.py", line 83, in __load
    root = nltk.data.find('{}/{}'.format(self.subdir, self.__name))
  File "C:\ProgramData\Anaconda3\lib\site-packages\nltk\data.py", line 699, 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')

  Attempted to load corpora/stopwords

  Searched in:
    - 'C:\\Users\\DELL/nltk_data'
    - 'C:\\ProgramData\\Anaconda3\\nltk_data'
    - 'C:\\ProgramData\\Anaconda3\\share\\nltk_data'
    - 'C:\\ProgramData\\Anaconda3\\lib\\nltk_data'
    - 'C:\\Users\\DELL\\AppData\\Roaming\\nltk_data'
    - 'C:\\nltk_data'
    - 'D:\\nltk_data'
    - 'E:\\nltk_data'
**********************************************************************

Process finished with exit code 1
petermr commented 3 years ago

Thanks, This should have a simple work-around by saving the stopwords in the ami system. Let's see who else has this problem.

Radhu903 commented 3 years ago

Okay @petermr

Radhu903 commented 3 years ago

after adding import nltk nltk.download('stopwords') Now it's give me this output

C:\ProgramData\Anaconda3\python.exe C:/Users/DELL/Radhu/openDiagram/physchem/python/search_lib.py
[nltk_data] Downloading package stopwords to
[nltk_data]     C:\Users\DELL\AppData\Roaming\nltk_data...
[nltk_data]   Unzipping corpora\stopwords.zip.
Traceback (most recent call last):
  File "C:/Users/DELL/Radhu/openDiagram/physchem/python/search_lib.py", line 351, in <module>
    main()
  File "C:/Users/DELL/Radhu/openDiagram/physchem/python/search_lib.py", line 343, in main
    AmiSearch.test_sect_dicts()
  File "C:/Users/DELL/Radhu/openDiagram/physchem/python/search_lib.py", line 160, in test_sect_dicts
    ami_search = AmiSearch()
  File "C:/Users/DELL/Radhu/openDiagram/physchem/python/search_lib.py", line 46, in __init__
    self.ami_projects = AmiProjects()
  File "C:/Users/DELL/Radhu/openDiagram/physchem/python/search_lib.py", line 205, in __init__
    self.create_project_dict()
  File "C:/Users/DELL/Radhu/openDiagram/physchem/python/search_lib.py", line 209, in create_project_dict
    self.add_with_check(AmiProjects.LIION10, os.path.join(PHYSCHEM_RESOURCES, "liion10"))
  File "C:/Users/DELL/Radhu/openDiagram/physchem/python/search_lib.py", line 215, in add_with_check
    Util.check_exists(file)
  File "C:\Users\DELL\Radhu\openDiagram\physchem\python\util.py", line 291, in check_exists
    assert os.path.exists(file), str(file) + " should exist"
AssertionError: C:\Users\DELL\projects\openDiagram\physchem\resources\liion10 should exist
running search main
dicts None
sects None

Process finished with exit code 1