When the name of the package does not match the name of the imported module, the wrong package is installed
system Closed
Bug description: 
When the name of the package does not match the name of the imported module, the wrong package is installed. 
It is possible to manually install the correct package, but the code editor keeps showing th&hellip;
https://global.discourse-cdn.com/business7/uploads/replitteams/optimized/1X/16cfad374523fd8b40ee9db741e059440a577693_2_32x32.png
Replit Ask
It is possible to manually install the correct package, but the code editor keeps showing the red wiggle. For example, after running the following in the shell, the code shown below works, but the red wiggle is still visible:

pip uninstall anvil pip uninstall anvil-uplink pip install anvil-uplink

Expected vs Current Behavior:

The correct package should be installed.

The red wiggle should disappear when the import succeeds.

Steps to reproduce:

Create a new python repl, add the following code and run:

import anvil import anvil.server print(anvil) print(anvil.server)

Bug appears at this link: https://replit.com/@stenci/InbornWealthyGigabyte#main.py

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

Replit Profile: https://replit.com/@stenci

Hello, auto-importing is an intended feature of UPM (Universal Package Manager). In python specifically, these guessed imports may be wrong, so you should tell it which package to import.

Example:

import pygame #upm package(pygame-ce)

Related:

It is usually best to disable import guessing in the packager configuration in .replit file, but unfortunately this is currently broken because of a bug.