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

4
  • 4
    what does pip freeze give as output? Also, if you're using python3, I recommend trying pip3 freeze > requirements.txt Commented Jan 8, 2021 at 13:42
  • the requirements file is still empty after using pip3 freeze > requirements.txt Commented Jan 8, 2021 at 13:47
  • 4
    Have you checked the output of pip3 freeze or pip freeze? Commented Jan 8, 2021 at 13:50
  • Does this answer your question? Why does `pip freeze` result in an empty file? Commented Jan 10, 2022 at 0:30

1 Answer 1

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.

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.