สวัสดีคุณต้องพบไฟล์นี้: font_manager.py ในกรณีของฉัน: C: \ Users \ gustavo \ Anaconda3 \ Lib \ site-Packages \ matplotlib \ font_manager.py
และค้นหา def win32InstalledFonts (directory = None, fontext = 'ttf') และแทนที่โดย:
def win32InstalledFonts (ไดเร็กทอรี = ไม่มี, fontext = 'ttf'): "" "ค้นหาฟอนต์ในไดเร็กทอรีฟอนต์ที่ระบุหรือใช้ไดเร็กทอรีระบบหากไม่มีการระบุรายการชื่อไฟล์ฟอนต์ TrueType จะถูกส่งคืนตามค่าเริ่มต้นหรือฟอนต์ AFM หากfontext == 'afm'. "" "
from six.moves import winreg
if directory is None:
directory = win32FontDirectory()
fontext = get_fontext_synonyms(fontext)
key, items = None, {}
for fontdir in MSFontDirectories:
try:
local = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, fontdir)
except OSError:
continue
if not local:
return list_fonts(directory, fontext)
try:
for j in range(winreg.QueryInfoKey(local)[1]):
try:
key, direc, any = winreg.EnumValue(local, j)
if not is_string_like(direc):
continue
if not os.path.dirname(direc):
direc = os.path.join(directory, direc)
direc = direc.split('\0', 1)[0]
if os.path.splitext(direc)[1][1:] in fontext:
items[direc] = 1
except EnvironmentError:
continue
except WindowsError:
continue
except MemoryError:
continue
return list(six.iterkeys(items))
finally:
winreg.CloseKey(local)
return None
~/.cache/matplotlib
และลองอีกครั้ง อาจเป็นปัญหาการอนุญาต - ไม่ควรสร้างแคชนั้นทุกครั้ง