2

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.

1

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

2 Comments

pip freeze installs all dependencies in your environment. I wouldn't recommend doing that if you're not in venv or something similar.
I was looking for an answer related to Spacy models. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.