Error when installing nltk packages on heroku

1k Views Asked by At

I am trying to install nltk packages in heroku using nltk.txt file. int my nltk.txt file only punkt is written. In requirements.txt file nltk is written. but when push it it shows the errors. Please help to fix my problem

remote: -----> Python app detected
remote:  !     Python has released a security update! Please consider upgrading to python-3.6.7
remote:        Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing requirements with pip
remote:
remote: -----> Downloading NLTK corpora…
remote: -----> Downloading NLTK packages: tokenize
remote: /app/.heroku/python/lib/python3.6/runpy.py:125: RuntimeWarning: 'nltk.downloader' found in sys.modules after import of package 'nltk', but prior to execution of 'nltk.downloader'; this may result in unpredictable behaviour
remote:   warn(RuntimeWarning(msg))
remote: Traceback (most recent call last):
remote:        [nltk_data] Error loading tokenize : Package 'tokenize ' not found in
remote:   File "/app/.heroku/python/lib/python3.6/runpy.py", line 193, in _run_module_as_main
remote:        [nltk_data]     index
remote:     "__main__", mod_spec)
remote:   File "/app/.heroku/python/lib/python3.6/runpy.py", line 85, in _run_code
remote:     exec(code, run_globals)
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/nltk/downloader.py", line 2272, in <module>
remote:        Error installing package. Retry? [n/y/e]
remote:     halt_on_error=options.halt_on_error)
remote:   File "/app/.heroku/python/lib/python3.6/site-packages/nltk/downloader.py", line 681, in download
remote:     choice = input().strip()
remote: EOFError: EOF when reading a line
remote: -----> Running post-compile hook
remote: -----> Running install_nltk_data
remote: -----> Starting nltk data installation
remote: /app/.heroku/python/lib/python3.6/runpy.py:125: RuntimeWarning: 'nltk.downloader' found in sys.modules after import of package 'nltk', but prior to execution of 'nltk.downloader'; this may result in unpredictable behaviour
remote:   warn(RuntimeWarning(msg))
remote: [nltk_data] Downloading package punkt to /app/nltk_data...
remote: [nltk_data]   Unzipping tokenizers/punkt.zip.
remote: bin/install_nltk_data: line 21: cd: '/app/nltk_data': No such file or directory
remote: -----> Finished nltk data installation
remote: -----> Post-compile done
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote:
remote: -----> Compressing...
remote:        Done: 49M
remote: -----> Launching...
remote:        Released v19
remote:        https://mysterious-coast-63128.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/mysterious-coast-63128.git
   7b1a415..9b14971  master -
0

There are 0 best solutions below