How to get the proper version?
ullix
ullix at urkam.de
Thu Mar 4 12:33:17 GMT 2021
Thanks. And yes, I now get both versions. However, at the expense of
having to do yet another import.
Am 04.03.21 um 11:08 schrieb Florian Bruhin:
> On Thu, Mar 04, 2021 at 09:18:47AM +0000, Phil Thompson wrote:
>> On 03/03/2021 14:55, ullix wrote:
>>> After my trouble installing PyQt5-5.15.3 I decided to log all package
>>> version numbers.
>>>
>>> Pip tells me I have these:
>>>
>>> PyQt5 5.15.3
>>> PyQt5-Qt 5.15.2
>>> PyQt5-sip 12.8.1
>>>
>>> But trying this in Python with the variable names in the middle
>>> column, I get:
>>>
>>> PyQt: PYQT_VERSION_STR --> 5.15.3
>>> PyQt-Qt: QT_VERSION_STR --> 5.15.2
>>> PyQt-sip: SIP_VERSION_STR --> 5.4.0
>>>
>>> This is obtained following Pythons official guidance:
>>>
>>> https://wiki.python.org/moin/PyQt/Getting%20the%20version%20numbers%20of%20Qt%2C%20SIP%20and%20PyQt
>> That's not "official", this is...
>>
>> https://www.riverbankcomputing.com/static/Docs/PyQt5/api/sip/sip-module.html#SIP_VERSION
>>
>>> But the sip version is obviously wrong. What kind of sip did I
>>> actually get, and how do I get the correct one?
>> You are confusing the SIP code generator (SIP_VERSION_STR: v5.4.0) and
>> PyQt5's sip module (v12.8.1). The module's version number corresponds to the
>> ABI that it implements. At the moment this isn't available from Python.
>>
>> Phil
> Note you can ask importlib_metadata about the package version:
>
> >>> import importlib_metadata
> >>> importlib_metadata.version('PyQt5-sip')
> '12.8.1'
>
> Florian
>
More information about the PyQt
mailing list