Ask coding questions

← Back to all posts
Why do libraries keep uninstalling themselves?
DwellerIgor

Hi there! I have discord.py bot and it is supposed to check if twitch streamer is live or not every 10 seconds, but in 10 minutes bot stops working (while I host it) and when I start my bot it reinstalls every library. Sometimes bot just stops working because some of the libraries keep uninstalling itself, so bot can't work 24/7. And some libraries like twitchAPI are not included in repl.it ,so I install them via console(shell) and in 10 minutes library uninstalls and I need to install it using console again. So the questions is: how to prevent libraries from uninstalling themselves?

Voters
DwellerIgor
Comments
hotnewtop
VulcanWM

When the bot switches off it restarts which means packages have to install again.
Just add flask to your bot and add uptimerobot to the url and it will stay up 24/7

DwellerIgor

thank you!
@VulcanWM

VulcanWM

np! Just mark the comment as the answer @DwellerIgor

DwellerIgor

wait. it doesn't work anymore. I have flask, but in 10 minutes library seems to uninstall itself and I get: "Your Replit is waking up". So still it doesn't work even with flask. any other suggestions? @VulcanWM

DwellerIgor

maybe you have discord. it will be much easier to communicate. @VulcanWM

Coder100

Libraries are big, so they get deleted.

But they get reinstalled each time you run the repl.

DwellerIgor

yes, but libraries like twitchAPI need to be installed using shell. I about 10 minutes replit forgets that i installed twitchAPI and just stopes working. How to fix that? It happens with libraries I install in shell @Coder100

Coder100

sure, you could use the .replit file to configure installing it each time you run @DwellerIgor

DwellerIgor

why does my bot stop working for no reason and then ask me to install everything again? Why? Just tell me please how to solve this @Coder100

Coder100

like i said
they delete the libraries to save space! @DwellerIgor

Coder100

so, in your .replit file, add this:

@DwellerIgor

DwellerIgor

thank you very much. sorry @Coder100

Coder100

np
sorry if i was hard to understand @DwellerIgor