question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding PySide2 fails to resolve version

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: Windows 10, Python 3.8.1
  • Poetry version: 1.0.2
  • Link of a Gist with the contents of your pyproject.toml file: See below

Issue

Adding PySide2 as a dependency seems to trigger a resolver bug. See below. python = "^3.8" seems to clash with PySide2’s limiter < 3.9. The package can be installed without problems in a 3.8.1 venv (pyside2 5.14.0 only works on Python 3.8.1+ on Windows).

~\AppData\Local\Temp
> poetry new ppp
Created package ppp in ppp
~\AppData\Local\Temp
> cd .\ppp\
~\AppData\Local\Temp\ppp
> cat .\pyproject.toml
[tool.poetry]
name = "ppp"
version = "0.1.0"
description = ""
authors = ["..."]

[tool.poetry.dependencies]
python = "^3.8"

[tool.poetry.dev-dependencies]
pytest = "^5.2"

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
~\AppData\Local\Temp\ppp
> poetry add pyside2=="^5.14"
Creating virtualenv ppp in C:\...\Temp\ppp\.venv

Updating dependencies
Resolving dependencies...

[SolverProblemError]
The current project's Python requirement (^3.8) is not compatible with some of the required packages Python requirement:
  - pyside2 requires Python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <3.9

Because no versions of pyside2 match >5.14,<6.0
 and pyside2 (5.14.0) requires Python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <3.9, pyside2 is forbidden.   So, because ppp depends on pyside2 (^5.14), version solving failed.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:10
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

18reactions
atollkcommented, Jul 8, 2020

Wouldn’t be it useful to improve the error message? Apparently multiple users are or were confused by it.

I think the natural interpretation of the syntax “Python = ^3.8” would be “My code requires features from 3.8, so use any Python version at least 3.8 that works with all packages”. It seems intuitive that Poetry would handle the compatibility and find that Python 3.9 is not an option.

14reactions
finswimmercommented, Jul 5, 2020

Hello,

when poetry resolves the dependency it tries to find a package version that is compatible to all python version, to which the project is compatible. In your case ^3.8 which means every python version >=3.8 and <4.0. pyside2 is not support for python >=3.9. So the dependency resolution fails.

The solution is to restrict the python version your project is compatible, e.g. ~3.8 which means >=3.8,<3.9.

If there exist an package that is compatible for a specific python version, one could also add those constraints to the pyproject.toml. See here.

fin swimmer

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do I keep getting errors when I try to install PySide2 on ...
I used the command pip install PySide2 . It is not working for me. Any help will be appreciated. Error: ERROR: Could not...
Read more >
2025599 – python-pyside2 fails to build with Python 3.11: error
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle. Changing version to 36. Comment 10 Miro Hrončok ......
Read more >
Unable to import anything from PySide2 - Python GUIs
The issue with Spyder is simply that it itself is built using Qt and defaults to PyQt5. If you try and run PySide2...
Read more >
Pip-Install Issue PySide2 on Windows10: shiboken2 DLL ...
After successfully installing PySide2 via pip on a fresh Windows10 + Python5.6.8, QT-Libraries cannot be imported at all. Error: .shiboken DLL missing This ......
Read more >
unable to install pyside2 on ubuntu
The missing package you're looking for is version 3.9 of libclang-dev (PySide2's build process uses libclang to parse the Qt C++ source), ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found