I have an nodeJS application that works perfectly on localhost, part of this NodeJS application has to run a python script which returns data using SYS. When I upload it to Heroku it fails when the python script is ran. Since I'm running the node application directly and not the python one it is difficult to get the error message directly. Instead I have put try and except messages everywhere and print messages to return to python (e.g. made it to the convert message section) and discovered it's 2 of the imports at the top of the file that is causing the python code to crash.
import sys
import spacy
import nltk
If I put the try after sys it appears that its not crashing on sys. Instead it's spacy and nltk which is causing the issues.
After some googling I found out I had to use requirements.txt to install like I would using Pip.
So in requirements.txt I have
spacy
nltk
(I tried using it with the version numbers initially but that fails)
However, this still doesn't fix the issue. I am a bit lost on how to fix this problem. Am I putting the wrong thing in requirements.txt or perhaps heroku doesnt run requirements when the nodeJS app is being ran first instead of a python file?
This is my first time using Heroku so I apologies if what I am doing wrong is obvious.
Thanks
Edit including photo of logs: