Package manager (upm) package guessing feature cannot be disabled, contrary to docs

Bug description:
Per the documentation, upm ‘package guessing’ can be disabled via .replit configuration

Expected vs Current Behavior:
When placing the following lines in your replit file (per the documentation found here: guessImports, upm should not try to guess packages based on imports:

language = "python3"

  guessImports = false

Expected behavior: the package manager should not guess.
Actual behavior: the package manager continues to guess and install imports, ignoring the setting.

why it matters: upm is really not great at guessing, and the extra dependencies it adds to your project take up space, can lead to conflicts, and so on. Being able to turn it off is essential.

Steps to reproduce:

  1. Create a new python repl
  2. add the above lines to the end of your .replit file
  3. add the statement from command.command import foo to
  4. run the replit

The package manager will guess that you want the package command@0.1.0 and will install it.

Browser/OS/Device: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Replit Profile:

Welcome to Ask! Can you provide the link to your Repl so we can take a look?

I agree that Replit should fix this, but this is a working solution for the meantime:

1 Like

This is reproducible with an empty repl – see “Steps to reproduce”

This does break the packager, so not a great workaround, as it disables an otherwise nice feature of replit.

I basically never use the packager and always call poetry directly regardless, but I can see how that would affect some people.


Edit: the problem has been fixed, (but it is a different configuration):

Breaking upm such as by deleting the contents of .upm/json and then using poetry instead is a sledgehammer solution, but sometimes an easier solution can be used (not always though):