Python-repl tries unsuccessfully to install a package that I don't use/want when using the Run button

Problem description:

I’ve recently rebuild a Python-repl from a Github repository since it was still listed as a bash repl (deleted the old one and imported it fresh). Every time I use the Run button now, the system is unsuccessfully attempting to install the gardener-cicd-libs package. Non of the files in the repl use that package, it’s a native Python repl without any packages installed. (I don’t even know what the package does.) I don’t have that problem with any other Python repl, even if I import them from Github. Also, it doesn’t happen when I run the file from the console.

Expected behavior:

When using the Run button only the resp. program should run, nothing else.

Actual behavior:

Poetry tries to install the gardener-cicd-libs package and the following message appears:

Replit: Updating package configuration

→ python3 -m poetry add gardener-cicd-libs
Using version ^1.1953.0 for gardener-cicd-libs

Updating dependencies
Resolving dependencies…

SolverProblemError

The current project’s Python requirement (>=3.8,<4.0) is not compatible with some of the required packages Python requirement:
- gardener-cicd-libs requires Python >=3.9.*, so it will not be satisfied for Python >=3.8,<3.9

Because no versions of gardener-cicd-libs match >1.1953.0,<2.0.0
and gardener-cicd-libs (1.1953.0) requires Python >=3.9.*, gardener-cicd-libs is forbidden.
So, because repl-nix-morsels depends on gardener-cicd-libs (^1.1953.0), version solving failed.

at venv/lib/python3.8/site-packages/poetry/puzzle/solver.py:241 in _solve
237│ packages = result.packages
238│ except OverrideNeeded as e:
239│ return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
240│ except SolveFailure as e:
→ 241│ raise SolverProblemError(e)
242│
243│ results = dict(
244│ depth_first_search(
245│ PackageNode(self._package, packages), aggregate_package_nodes

• Check your dependencies Python requirement: The Python requirement can be specified via the python or markers properties

For gardener-cicd-libs, a possible solution would be to set the python property to “>=3.9,<4.0”

Dependency specification | Documentation | Poetry - Python dependency management and packaging made easy

exit status 1

Replit: Package operation failed.

Steps to reproduce:

I don’t know if you can run the repl?

Bug appears at this link:

https://replit.com/@Timsbim/Morsels#current.py

Browser/OS/Device:

Independent of Browser/OS/Device

After running your repl, I was in fact able to reproduce the issue. One of the things that seem missing in your repl are the default packager files (poetry.lock, requirements.txt). Does adding those and specifying only the correct packages work for you?

Thanks for the reply! I have added a poetry.lock file from a fresh Python repl, but it hasn’t changed anything. I don’t know how the requirements.txtshould look like and where it is located (haven’t found it in the fresh repl), so I couldn’t try it.

I figured out what was causing the issue. I simply turned guessImports to false in your .replit file and everything is working now.

Screen Shot 2023-01-18 at 2.54.06 PM

3 Likes

Great, thanks a lot! :grinning:

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