pythondiscorddiscord.pyreplitmo

How to install modules on the shell automatically on repl.it using python


I am making a discord bot, for this I needed to make buttons for an embed, and to do that I needed to import a library. Once I imported it in the code replit would say that there is no module named discord_slash, so I went into the shell and used pip install discord-py-interactions, and then the code worked, however each time I leave replit and come back to it I need to repeat this process for the code to work. How to make it so that it automatically installs that library when I run the program?

before installing: Nothing was changed in the code. Just used pip to download it in the shell. After installing:


Solution

  • I figured out how to do it. Use the packages system on replit to install the module, then it will be installed permanently.