Ask coding questions

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

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?

Comments
hotnewtop
VulcanWM (2766)

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

VulcanWM (2766)

np! Just mark the comment as the answer @DwellerIgor

DwellerIgor (0)

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 (0)

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

Coder100 (18176)

Libraries are big, so they get deleted.

But they get reinstalled each time you run the repl.

DwellerIgor (0)

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 (18176)

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

DwellerIgor (0)

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 (18176)

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

Coder100 (18176)

so, in your .replit file, add this:

run = "<command to install your lib> ; python main.py"

@DwellerIgor

DwellerIgor (0)

thank you very much. sorry @Coder100

Coder100 (18176)

np
sorry if i was hard to understand @DwellerIgor