PyQt-builder does not build Designer plugin in conda environment
Ivan Sinkarenko
ivan.sinkarenko at cern.ch
Wed Aug 10 10:26:31 BST 2022
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.
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.
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.
Cheers,
Ivan
More information about the PyQt
mailing list