Imports in python are not installed automatically

Hi, a came across with something that was not happening last week in one of my replit apps. I have a discord bot that was working without any issues, but suddenly this week, every time it is activated automatically by the container, it throws “module not found error”. This happens with all the modules that it needs to import. So, now I need to install them manually from the shell every time this happens. Once I install the packages manually, it works, but then randomly after one day or two, it throws the same error, and I need to redo the process. This is really annoying.

To add more context, I checked the packages component and all the modules are installed there. I also tried to create a requirements.txt file and it didn’t work. It is weird because I didn’t touch anything in the code. Also, the app is private and I have it set to “Always on”.

I would appreciate if anyone could give me some guidance in how to solve this issue.

Thank you!

1 Like

Welcome to the community, @jortizco! Can you provide a screenshot of the error this throws? Thanks!

a link to a minimal repl which reproduces the issue would be helpful.
See if there are any packager errors which flash up and then disappear just before the code runs. Make sure guessImports is enabled in the packager section of the .replit file

1 Like

Attached is an screenshot of the error. Sorry for the delay but this error happens randomly. Usually after one day or two since the last run.

Yes, when it flash up a message in red and then disappear just before the code run.

run poetry update in shell next time this happens to see what the error is

1 Like

I get the same error as the one described in this post Package operation failed in package manager is describing when I run poetry update. Basically, replit is not installing the packages from the package manager (although they are listed there as installed), but the app works when I install them with “pip3 install …” from the shell. Again, this happens randomly after one or two days since the last execution of the app.

seems like a poetry bug. Update poetry by running in shell:

pip install -U 'poetry==1.*'
1 Like