Bot doesn't work after dependency update

Hi guys, hope someone can help me to understand better how to manage the risk of libraries updates.

I have these two bot, one for telegram and one for discord, built with the same logic and both were working properly until yesterday

Today when I runned the code, both Repl downloaded and installed the updated of several dependencies, the most “essential” included (qdrant, langchain, openai).

Since the updates, my bots don’t work and I didn’t touch the code. I spent hours to trying to figure out modifying the code but I didn’t fixed the code.
Now I find as a solution to re-install the previous versions of the libraries which caused the issue, but now I’m scared of the random updates, so I would like to ask you:

  1. Can I avoid the risk of random updates with the “requirements.txt” file where inside there are the specific version of the libraries? If not, how can I avoid random updates of essential libraries and update them only when I want?
  2. The updates of the libraries which caused the error were: pip install langchain-community==0.0.17, pip install langchain==0.1.5 and pip install grpcio-tools==1.60.0.
    Now I have these version of the libraries: pip install grpcio-tools==1.59.3, pip install langchain-community==0.0.10 and pip install langchain==0.1.0.

I know I’m asking difficult questions, but is there a risk that the version of the libraries I’m using become deprecated soon?

I’m a Core user, so maybe I have dedicated support if I’m not wrong, if I send the code to the support or I paste the code here, could someone give a look and show me how to fit the new version of the libraries with my code? I’m quite sure it’s just matter of few lines of code, because the code was perfect before the updates

1 Like

Hi @RicascoLTD !
I don’t think requirements.txt works in Replit, you’ll need to use pyproject.toml. Also, avoid using pip install[1], use poetry add. Thirdly, in your .replit file, try adding these 2 lines below the entrypoint:

disableGuessImports = true
disableInstallBeforeRun = true

Hope this helps!

  1. as pip is unreliable on Replit ↩︎


thank you so much @NateDhaliwal , you shocked me because you just destroyed several my habits! :smiley:

Forgive me for my experience, but I would like to ask some more details:

  1. so I have to add a pyproject.toml file in my repl where I write the libraries and related versions, right?
  2. so if I want to install langchain in a repl, you suggest me to prompt in the shell poetry add langchain, right?
  3. do I add this code
disableGuessImports = true
disableInstallBeforeRun = true

below the entrypoint of my “” file, right? For .replit file you should mean whatever inside the Repl

Sorry if some questions could be stupid, but I’m a noob :smiley:

Hi @RicascoLTD !
The pyproject.toml already exists. Just take a look below the poetry.lock file. You should see the installed modules with their versions.

Oh dear…

Yes, that should work!

No, actually there is a file called .replit. At the top of the Files sidebar, click the 3 dots and then click Show Hidden Files. Scroll to the bottom of the list of files and enter the .replit file. Type in the necessary lines below the entrypoint line.

That’s alright! I was a noob too when I first entered the forums!

Hope this helps!

Do let me know if this works/doesn’t work!


thank you so much! now I understood everything what you mean :pray:

Gonna add the code in .replit

Regarding the “requirements.txt” and “pip install” I would like a confirmation about the staff because I’ve always used them without any problem, so I want to understand if I made something wrong or it’s good anyway

You’ve always used them in Replit or in other IDEs?

Many community members can assure you on this one. It can say it installs the modules, but I sometimes still get ModuleNotFoundError.

I can ask @SuzyAtReplit for confirmation.

1 Like

I’ve always used them in Replit, yes. pip install for every code I built, “requirements.txt” just during the first versions of the bot, then I deleted it thinking I didn’t need it but I was wrong because probably the automatic updates were caused because of no “requirements.txt” in the Repl

@RicascoLTD We’ve made recent improvements to pip install so you (and anyone else reading this, please) are welcome to submit any bug reports where it’s not working properly. Same idea with requirements.txt.

The only thing I would add is that you may have to clear out poetry.lock and project.toml, but our team is working on a fix soon which does that automatically on GitHub import. Again, the improvements are pretty new so we’d love feedback or bug reports if any issues are encountered.

1 Like