How to install packages for your bot (requirements.txt and package.json)
Add Python or Node.js packages to your ESN bot the right way, pin versions and fix "module not found" errors.
You don't run pip or npm yourself on ESN. You list the packages your bot needs in a file, and the server installs them every time it starts.
Python: requirements.txt #
- Create a file called
requirements.txtin your server's top folder (the same folder as your main file). - Put one package per line, for example:
discord.py
python-dotenv
aiohttp
- Restart the server from Console. On every start it runs
pip install -r requirements.txt, then your main file.
Tip: on your own computer, pip freeze > requirements.txt writes out everything installed there. Trim it to what your bot actually uses, because extra packages slow down every start.
Node.js: package.json #
- On your computer, in your bot's folder, run
npm install discord.js dotenv(with your own packages). That adds them topackage.json. - Upload
package.json(andpackage-lock.jsonif you have it) to the top folder. Don't uploadnode_modules. - Restart. On every start the server runs
npm installwhen there's apackage.json, then your start file.
Pin versions so updates don't break your bot #
Without a version, you get the newest release on every start, and a big update can break your code overnight. Pin the versions you tested with:
discord.py==2.4.0
python-dotenv==1.0.1
In Node.js, package-lock.json does this for you, so upload it with package.json.
Common errors #
- ModuleNotFoundError: No module named 'x': the package isn't in
requirements.txt, or the file isn't in the top folder. Some packages import under another name than they install as, for exampleimport dotenvneedspython-dotenv. - Cannot find module 'x': add it to
package.jsonas above. If the missing module is your own file, check the path and capitals. - ERROR: Could not find a version that satisfies the requirement: a typo in the package name, or a version that doesn't exist for your Python version. Try another Python version in the Docker Image box on the Startup page.
- Disk full while installing: delete old logs and archives in Files. See Troubleshooting.
Still stuck? Use the live chat on the panel or ask in the ESN Hosting Discord. Last updated October 27, 2026.