Skip to main content

How To Use requirements.txt on Your Python Discord Bot

What is requirements.txt?

The requirements.txt file is a simple text document that tells your hosting server which external Python libraries your bot needs to function. Instead of manually typing pip install package_name every time you move your bot to a new server, the host reads this file and automatically installs everything listed inside it during the build process. This ensures your bot has the exact same tools in the cloud as it does on your computer.


1. Log In to Your Panel


2. Select The ‘Files’ Tab

Cybrancee Panel in the files page, "Files" tab on the sidebar is highlighted

3. Create The ‘requirements.txt’ File

Create a new file named requirements.txt. List the required packages by name, ensuring each one is on a separate line.

An example requirements.txt file

discord.py
python-dotenv

4. Select The ‘Startup’ Tab

Cybrancee Panel the startup tab is highlighted in files page

Now, ensure the ‘Requirements File’ field is set to requirements.txt

Cybrancee Panel, the REQUIREMENTS FILE card is highlighted

5. Start Your Bot

You should now see the packages listed in requirements.txt being downloaded in your server console.

Discord Bot Hosting

Starts at $1.49

External link icon
Was this article helpful?
Please Share Your Feedback
How Can We Improve This Article?
Table of Contents