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
Asked
Active
Viewed 1,348 times
0

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

Just starting
- 1
- 1
-
4what does `pip freeze` give as output? Also, if you're using `python3`, I recommend trying `pip3 freeze > requirements.txt` – some_programmer Jan 08 '21 at 13:42
-
the requirements file is still empty after using pip3 freeze > requirements.txt – Just starting Jan 08 '21 at 13:47
-
4Have you checked the output of `pip3 freeze` or `pip freeze`? – some_programmer Jan 08 '21 at 13:50
-
Does this answer your question? [Why does \`pip freeze\` result in an empty file?](https://stackoverflow.com/questions/40192651/why-does-pip-freeze-result-in-an-empty-file) – Gino Mempin Jan 10 '22 at 00:30
1 Answers
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)
- Navigate to the folder containing your .py files in the Terminal
- python3 -m venv venv
- 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.

Anthony Nolletti
- 1
- 2