Terminator_ng
Terminator_ng

Reputation: 21

Installing Python dependencies in Heroku

I wanted to make an Ai chatbot hosted on Heroku, but there are some problems with installing the requirements.

The chatbot needs the following packages:

  1. discord
  2. pytorch
  3. spaCy

I already figured out putting discord into the requirements.txt, but I got no clue on how to do the other two dependencies. The problem with them is that they aren't just installed with

pip install NAME_OF_THE_PACKAGE .

Pytorch for example needs:

pip install torch==1.7.0+cpu torchvision==0.8.1+cpu torchaudio==0.7.0 -f https://download.pytorch.org/whl/torch_stable.html

and spaCy needs

pip install -U spacy

pip install -U spacy-lookups-data

python -m spacy download en_core_web_sm.

I tried different variations of the commands above, but none worked. Now I even reached the built limit on my account. Please help me if you know how to solve the problem.

Upvotes: 2

Views: 526

Answers (1)

ar_n
ar_n

Reputation: 56

You can use the following to create a requirements.txt file having all the dependency installed in your current environment. This will install

pip freeze > requirements.txt

To download the Spacy Models, you can add this in the requirements.txt

https://github.com/explosion/spacy-models/releases/download/en_core_web_trf-3.0.0a0/en_core_web_trf-3.0.0a0.tar.gz

For more info, go through this issue on Github

https://github.com/explosion/spaCy/issues/1129

Upvotes: 2

Related Questions