Search code examples
pythonfontspyqt5warnings

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


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

  • I finally found what's wrong! The fonts listed in the warning are somehow incompatible with PyQt5, so I just need to delete them. This is the link on how to delete fonts in Windows 10 (From www.tenforums.com).

    1. Press the Win+R keys to open Run, type regedit into Run, and click/tap on OK to open Registry Editor.

    2. Navigate to the key below in the left pane of Registry Editor. (see screenshot below) HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Fonts enter image description here

    3. In the right pane of the Fonts key, right click on the string value for the font (ex: "Agency FB Bold (TrueType)") you want to delete, and click/tap on Delete. (see screenshot above)

    Be sure to make note of the font file name (ex: "AGENCYB.TTF") you are deleting before you delete the string value.

    1. Click/tap on Yes to confirm. (see screenshot below) Delete and Uninstall Fonts in Windows 10-confirm_delete_font_in_regedit.png

    2. When finished deleting fonts, close Registry Editor.

    3. Sign out and sign in again to the same account.

    4. Open File Explorer (Win+E).

    5. Copy and paste %LocalAppData%\Microsoft\Windows\Fonts into the address bar of File Explorer, and press Enter.

    6. Delete the same font(s) (ex: "AGENCYB.TTF") referenced from step 3 above. (see screenshot below) Delete and Uninstall Fonts in Windows 10-delete_font_for_current_user_in_regedit-2.jpg

    7. You can now close File Explorer if you like.