Can't install Python module "rembg" in Replit

For some reason, no matter what, it seems as though trying to install the “rembg” / remove background module in Python always results in failure.

The error has to do with dependency conflicts.

After trying to manually revert the version of the “typing_extensions” module (Rembg isn’t compatible with typing_extensions version 4.0.0 yet), Python simply reinstalls the latest version of “typing_extensions.”

Is there something much more obvious that I’m missing? Attached is the final implementation I attempted before making this post. TIA!

https://replit.com/@WilliamUemura/openCv-tutorial-1#main.py

Hi @WUemura thank you for your post.

I think you have set your Repl to be private as I cannot see the code when I click on the link.

1 Like

I deleted the Replit in question because it had one line: “import rembg”. Besides that, the project was a boilerplate Python repl.

I’ve tried downloading through both Replit’s packages manager and the CLI. I’ve also tried manually rewriting dependency files and cloning working GitHub builds using the “rembg” module into Repl.

I recreated the replit at replit.com/@WilliamUemura/rembg where the problem persists.

Hey @WUemura,

could this article help?

Hi @Hugo,

Although the article itself didn’t include the solution, it led me to finding out the error.

It turns out that ONNXRuntime, a rembg dependency, requires PyTorch & TensorFlow to run, the latter of which is too large to fit onto the disk of a free Repl.

Because of that, I’m pretty sure that use of “rembg” is reserved for boosted Repls.

Thank you for your help!

3 Likes

Thanks for posting this @WUemura as I was also having difficulty setting up rembg last night, investigating what could be the cause.

1 Like