Solver tries to resolve dependencies not required on platform
See original GitHub issue- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name: Any
- Poetry version: v1.0.5
- Link of a Gist with the contents of your pyproject.toml file: https://github.com/ActivityWatch/aw-watcher-afk/blob/dev/removed-excessive-windows-deps/pyproject.toml
Issue
I’m trying to remove some unneeded dependencies from my project since they are no longer used (pypiwin32 and pyHook).
However, a dependency (PyUserInput) that is still needed on Linux depends on these two old dependencies, but only on Windows.
Since PyUserInput is only a dependency for Linux (selected with platform = "linux"
) I shouldn’t need to install these other two dependencies on Windows anymore, yet the solver complains:
[SolverProblemError]
Because no versions of pyuserinput match !=0.1.12
and pyuserinput (0.1.12) depends on pypiwin32 (*), every version of pyuserinput requires pypiwin32 (*).
So, because no versions of pypiwin32 match *
and aw-watcher-afk depends on pyuserinput (*), version solving failed.
PR with changes here: https://github.com/ActivityWatch/aw-watcher-afk/pull/39
Failing CI run here: https://github.com/ActivityWatch/aw-watcher-afk/pull/39/checks?check_run_id=564392363
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6 (4 by maintainers)
Top Results From Across the Web
[Video] ActiveState Platform: How To Resolve a Solver Error
The ActiveState Platform attempts to resolve dependencies whenever you add a new package to your environment. If you encounter a Solver ...
Read more >Maven Could not resolve dependencies, artifacts could not be ...
This error can be reproduced every time I try to build something with maven. Doing mvn dependency:tree, dependency:list, or the usual build ...
Read more >NuGet Package Dependency Resolution - Microsoft Learn
Note that the packages do not need to be on the same distance for the cousin ... With packages.config , NuGet attempts to...
Read more >IntelliJ not resolving Maven dependencies
Delete the .idea folder and the .iml files; Delete my maven repository folder; Update the maven repositories indices in IntelliJ; Delete the ...
Read more >apt - How do I resolve unmet dependencies after adding a PPA?
Since removing the package you are trying to install may not be ideal, you might also try finding a repository that has the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ErikBjare the traceback with
-vvv
should provide an idea of the codepath.The relevant block here could be https://github.com/python-poetry/poetry/blob/6e053e5599acdf1e186a8853c6256646c56a4a7d/poetry/puzzle/solver.py#L102-L103
The issue seems to be that poetry is requesting an install operation even if that package is not required. It could also be handled deeper in the
Install
logic too. Ideally, it should both skip the package and ensure that any unnecessary install/solve operation is not performed during instsall time.Closing this as an upstream issue, as explained by @dimbleby. Please contact the maintainer of this package and ask them to fix it.