بارك الله فيك وزادك علما وفضلا
بعد أن نسخت الكود الذي تكرمت بارساله ظهرت لي سلسلة الأخطاء التالية علما بأن المكتبات المطلوبة مثبة بواسطة الpip. ههلا أرشدتني إلى خطأي؟ وشكرا لك
C:\Users\k.shalabi\AppData\Local\Programs\Python\Python311\python.exe H:\sqlite\pdf5h.py
Traceback (most recent call last):
File "C:\Users\k.shalabi\AppData\Local\Programs\Python\Python311\Lib\site-packages\reportlab\pdfbase\pdfmetrics.py", line 697, in getFont
return _fonts[fontName]
~~~~~~^^^^^^^^^^
KeyError: 'Arabic'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "H:\sqlite\pdf5h.py", line 35, in <module>
document.build([table])
File "C:\Users\k.shalabi\AppData\Local\Programs\Python\Python311\Lib\site-packages\reportlab\platypus\doctemplate.py", line 1317, in build
BaseDocTemplate.build(self,flowables, canvasmaker=canvasmaker)
File "C:\Users\k.shalabi\AppData\Local\Programs\Python\Python311\Lib\site-packages\reportlab\platypus\doctemplate.py", line 1082, in build
self.handle_flowable(flowables)
File "C:\Users\k.shalabi\AppData\Local\Programs\Python\Python311\Lib\site-packages\reportlab\platypus\doctemplate.py", line 931, in handle_flowable
if frame.add(f, canv, trySplit=self.allowSplitting):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\k.shalabi\AppData\Local\Programs\Python\Python311\Lib\site-packages\reportlab\platypus\frames.py", line 158, in _add
w, h = flowable.wrap(aW, h)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\k.shalabi\AppData\Local\Programs\Python\Python311\Lib\site-packages\reportlab\platypus\tables.py", line 1346, in wrap
self._calc(availWidth, availHeight)
File "C:\Users\k.shalabi\AppData\Local\Programs\Python\Python311\Lib\site-packages\reportlab\platypus\tables.py", line 735, in _calc
self._calc_width(availWidth,W=W)
File "C:\Users\k.shalabi\AppData\Local\Programs\Python\Python311\Lib\site-packages\reportlab\platypus\tables.py", line 542, in _calc_width
t = self._elementWidth(v,s)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\k.shalabi\AppData\Local\Programs\Python\Python311\Lib\site-packages\reportlab\platypus\tables.py", line 608, in _elementWidth
return max([stringWidth(x,fontName,fontSize) for x in v])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\k.shalabi\AppData\Local\Programs\Python\Python311\Lib\site-packages\reportlab\platypus\tables.py", line 608, in <listcomp>
return max([stringWidth(x,fontName,fontSize) for x in v])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\k.shalabi\AppData\Local\Programs\Python\Python311\Lib\site-packages\reportlab\pdfbase\pdfmetrics.py", line 733, in stringWidth
return getFont(fontName).stringWidth(text, fontSize, encoding=encoding)
^^^^^^^^^^^^^^^^^
File "C:\Users\k.shalabi\AppData\Local\Programs\Python\Python311\Lib\site-packages\reportlab\pdfbase\pdfmetrics.py", line 699, in getFont
return findFontAndRegister(fontName)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\k.shalabi\AppData\Local\Programs\Python\Python311\Lib\site-packages\reportlab\pdfbase\pdfmetrics.py", line 681, in findFontAndRegister
face = getTypeFace(fontName)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\k.shalabi\AppData\Local\Programs\Python\Python311\Lib\site-packages\reportlab\pdfbase\pdfmetrics.py", line 638, in getTypeFace
return _typefaces[faceName]
~~~~~~~~~~^^^^^^^^^^
KeyError: 'Arabic'
Process finished with exit code 1