Spire.Xls version:14.2.2
Python 3.11.8
Hello, I'm trying to use Python Spire.Xls to convert EXCEL to PDF on MACOS. I ran your demo code ToPDF.py in your Demos/07_Conversion
The result is showing
Traceback (most recent call last):
File "/Users/sebastian/Documents/spire.xls.python_14.2.2/Demos/07_Conversion/ToPDF.py", line 9, in <module>
workbook = Workbook()
^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/plum/function.py", line 642, in __call__
return self.f(self.instance, *args, **kw_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/plum/function.py", line 592, in __call__
return _convert(method(*args, **kw_args), return_type)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/spire/xls/Workbook.py", line 18, in __init__
intPtr = CallCFunction(GetDllLibXls().Workbook_CreateWorkbook)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/spire/xls/common/__init__.py", line 109, in CallCFunction
raise SpireException(info)
spire.xls.common.SpireException: TypeInitialization_Type_NoTypeAvailable: at System.Runtime.CompilerServices.ClassConstructorRunner.EnsureClassConstructorRun(StaticClassConstructionContext*) + 0x160
at System.Runtime.CompilerServices.ClassConstructorRunner.CheckStaticClassConstructionReturnNonGCStaticBase(StaticClassConstructionContext*, IntPtr) + 0x14
at Spire.Xls.Core.Spreadsheet.XlsWorksheet.InitializeCollections() + 0x2a4
at Spire.Xls.Core.Spreadsheet.XlsWorksheet..ctor(Object) + 0x74
at Spire.Xls.Core.Spreadsheet.Collections.XlsWorksheetsCollection.Add(String) + 0x70
at Spire.Xls.Core.Spreadsheet.XlsWorkbook.spra(Int32) + 0x400
at Spire.Xls.Workbook..ctor() + 0x58
at Spire.Xls.AOT.NLWorkbook.CreateWorkbook(IntPtr) + 0x40
Exception ignored in: <function Workbook.__del__ at 0x1067b5d00>
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/spire/xls/Workbook.py", line 23, in __del__
CallCFunction(GetDllLibXls().Workbook_Dispose, self.Ptr)
^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/spire/xls/common/SpireObject.py", line 27, in Ptr
return self._ptr
^^^^^^^^^
AttributeError: 'Workbook' object has no attribute '_ptr'