Wednesday, April 27, 2022

[FIXED] How to fix/hide `Unable to enumarate family warning` in pyqt5?

Issue

Each time I run my python script I'm facing this warning:

qt.qpa.fonts: Unable to enumerate family

What can be the cause of this warning? How do I fix this warning? If this warning can't be fixed, how can this hide or silenced?

Edit: I've tried to install all the fonts in the warning but it still persists.

The warning is on the left side of the picture and the list of fonts installed in my Windows 10 system is on the right side. enter image description here


Solution

Warning is just a hint for the developer, not an error. You can hide this warning with:

import warnings
warnings.filterwarnings('ignore')

Im not sure about this warning but i think this warning often occurs when PyQt5 cannot find any fonts in your system.

Most often it means that you don't have fonts installed on your system. So, try to install them.

Most often fonts are installed in /usr/share/fonts directory. You can install fonts by using command:

sudo apt-get install xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic

If you are using other distribution, you can search for similar command and install fonts.



Answered By - Leon Zajchowski
Answer Checked By - Mildred Charles (PHPFixing Admin)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.