Ask coding questions

← Back to all posts
My discord.py repl.it uninstalls all the external modules overnight
MrDaddyCool

My discord.py replit uninstalls all the external modules overnight automatically and I have to reinstall them again each day, how do I fix this? If it has anything to do with the fact that its connected to GitHub and I'm using UpTimeRobot, please tell me.

Voters
MrDaddyCool
Comments
hotnewtop
bendev9

It’s got nothing to do with GitHub or UpTimeRobot. Repl.it hosts your IDE environment in a “container” which is basically a virtual computer. Packages don’t persist between containers, so whenever you get given a new container, you have to re-install the packages.

EDIT: spelling :)

MrDaddyCool

Is there any ways to fix this @bendev9?

MrDaddyCool

@bendev9 what if I download the package files and uploaded them the next day?

bendev9

@MrDaddyCool, the best way to maintain packages between containers is to use poetry as @Saml2020 suggests. You can either use the packager UI in the left panel (the small box icon), or use the command line by putting python3 -m poetry add [package name]. It works similar to pip, except it stores the packages that you’ve installed, and will install the newest version each time.

Saml2020

Instead of using pip to install the package, use this command
poetry add git+https://github.com/Rapptz/discord.py
Replit uses poetry and will reinstall the packages.

MrDaddyCool

@Saml2020 The repl.it's code isn't working now...

Saml2020

@MrDaddyCool Type kill 1 in shell. And reload the page.

MrDaddyCool

@Saml2020 It still doesn't work, could you look through the code and see if there's something wrong there? I tried and I've only got errors for the discord_components module which was cooperating before. Maybe I could change the interpreter? If so, how? I'll be checking too. But for now, seriously you've been such a wonderful helper thank you so much.

MrDaddyCool

@Saml2020 Don't worry I've fixed it now