0

Okay so I want to host my discord bot in Heroku but for the requirements.txt when I use the command pip freeze > requirements.txt in the Cmd it creates the file but with no text in it

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135

1 Answers1

0

You were likely on your global environment, so your virtual environment has no dependencies installed. To fix:

Start your virtual environment (on Mac/Linux)

  1. Navigate to the folder containing your .py files in the Terminal
  2. python3 -m venv venv
  3. source venv/bin/activate

This isn't ideal, but 1-by-1 install your dependencies using "pip install <dependency_name>". You can find your dependency names usually by looking at your "import " statement at the top of your python file. Alternatively, you can find them using:

python3 <app_name.py>

The error message that results in the Terminal will show you the missing dependency.

If "pip3 install <dependency_name>" doesn't work, search on PyPi for the correct name to install. Sometimes they vary.