PyQt-builder does not build Designer plugin in conda environment
Phil Thompson
phil at riverbankcomputing.com
Wed Sep 7 17:24:16 BST 2022
On 10/08/2022 10:26, Ivan Sinkarenko wrote:
> Hello Phil,
>
>
> Trying to build PyQt5 from source, I ran into issue, where Qt Designer
> plugin would not be built.
>
> PyQt-builder checks for sysconfig.get_config_vars() information in
> CONFIG_ARGS and LDLIBRARY flags.
> However, conda's Python is build statically linking to libpython, and
> they provide libpython.so in addition to that in every environment.
>
> Some pointers could be found here:
> https://github.com/conda-forge/python-feedstock/issues/222#issuecomment-436446961
>
> Python 3.7 used to have --enable-shared configuration flag, but in
> Python 3.9 this is no longer the case.
--enable-shared is present in all Python versions as far as I can tell.
> It seems that it might be affecting the PyQt conda-forge package for
> that reason: https://github.com/conda-forge/pyqt-feedstock/issues/113
>
> To verify:
>> docker run -it continuumio/miniconda3 python -c 'import sysconfig;
>> print(sysconfig.get_config_vars("CONFIG_ARGS"))'
>> ... output will not have "--enable-shared" ...
>
>> docker run -it continuumio/miniconda3 python -c 'import sysconfig;
>> print(sysconfig.get_config_vars("LDLIBRARY"))'
>> ['libpython3.9.a']
>
>> docker run -it continuumio/miniconda3 bash -c 'find /opt/conda -name
>> "*libpython*"'
>> /opt/conda/lib/libpython3.9.so.1.0
>> /opt/conda/lib/libpython3.9.so
>> /opt/conda/lib/libpython3.so
>
> PyQt-builder already looks for libpython.so with glob, but only after
> sysconfig assumptions are met.
> Bypassing those assumptions solves the problem.
This can be configured using pyproject.toml, see...
https://www.riverbankcomputing.com/static/Docs/PyQt-builder/pyproject_toml.html#tool-sip-project-section
> As a side note, in PyQt-builder's code, sysconfig gets imported via
> distutils, while it can be imported directly from the stdlib.
> Recent versions of setuptools can get upset when somebody imports
> distutils before them, so it could be useful
> to minimize that.
Fixed, thanks.
Phil
More information about the PyQt
mailing list