Python: Packages tool not working

Problem description:
When I try to install a package via the Packages tool, it fails with Could not find a matching version of package <version>, for any python package that I try to install. The <version> is what version is listed in the search, and the version specified in the install command.

Expected behavior:
Install the package, without errors.

Actual behavior:
After the add command in the shell, it gives this error message:

--> poetry add 'replit 3.5.0'
Using version ^3.5.0 for replit

Could not find a matching version of package 3.5.0
exit status 1

The shell command in the output also does not work. However, a plain shell command install with no version specified will install correctly. Import guessing does not specify the version so it also still works.

It seems that the package name and the version specified are interpreted as two separate packages, but of course 3.5.0 isn’t an actual package, so there is an error. The space in between the package name and version should instead be a @ or ==.

Steps to reproduce:
Create a new python repl with the official template. Open the Packages tool and click Install for any python package. It fails because of the bad formatting. The versionless shell command counterpart will work for the same package and install the same version (the latest one).

Also, the Packages tool does not allow the user to specify what version to use, which is another reason why a lot of people just use shell commands.

Workarounds:
Use a shell command to install the package, or use auto guessing.
Import guessing:

import replit  # <- replit package will be auto installed by this when repl is run

Shell commands (will not install System Dependencies automatically):

poetry add replit
poetry add replit@3.5.0
2 Likes

If we downgrade the package to a previous version (not 3.5.0), will it work?

1 Like

(The Packages tool does not have version functionality, but shell commands do.)

Thanks for the suggestion.
After some testing, I have concluded that the bug is that poetry add replit 3.5.0 is interpreted as replit and 3.5.0 being two separate packages. However, this is how the Packages tool formats its commands (poetry add 'replit 3.5.0').

It’s new isn’t it? It didn’t use version numbers when using guess imports?

This has always been how the Packages tool worked. And you are correct, import guessing does not specify a version, it is a plain install.

2 Likes

Screenshot(s)/Screen Recording:

Bug description:
I Can’t Install any python packages.

Expected vs Current Behavior:

Steps to reproduce:
Install any package.
Error:
→ poetry add ‘replit 3.5.0’
Using version ^3.5.0 for replit

Could not find a matching version of package 3.5.0
exit status 1

Bug appears at this link: https://replit.com/@Jinhongwang/HappyTidings

Screenshot(s)/Screen Recording:

Browser/OS/Device: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36

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

Hi @Jinhongwang , welcome to the forums!
Go to the .replit file and enter this line below entrypoint:

disableGuessImports = true

Then, avoid using the Packager tool to install packages as it is buggy.
Enter poetry add replit flask in the Shell. This should install the packages.
Hope this helps!

1 Like

That’s not really necessary in this case, they just need to do the installs manually. (And actually, auto-installing might be fine)

1 Like

Auto installs and manual shell installs both work.

Original bug report:

1 Like

Thanks for sharing this issue @NuclearPasta0. I know the team is making improvements in this area, but let me get the issue officially filed internally.

2 Likes

This should be fixed now @NuclearPasta0 .

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.