ESN Docs

Docs › Discord bots

How to install packages for your bot (requirements.txt and package.json)

2 min readUpdated Oct 27, 2026

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 #

  1. Create a file called requirements.txt in your server's top folder (the same folder as your main file).
  2. Put one package per line, for example:
discord.py
python-dotenv
aiohttp
  1. 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 #

  1. On your computer, in your bot's folder, run npm install discord.js dotenv (with your own packages). That adds them to package.json.
  2. Upload package.json (and package-lock.json if you have it) to the top folder. Don't upload node_modules.
  3. Restart. On every start the server runs npm install when there's a package.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 example import dotenv needs python-dotenv.
  • Cannot find module 'x': add it to package.json as 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.