Question

ZOS-API not compatible with modern versions of Python and pythonnet

  • 17 March 2023
  • 1 reply
  • 29 views

Hi,

 

I have read this knowledgebase article on how to use pythonnet with ZOS-API. It suggests using Python 3.4 to 3.8. Yet, 3.4 to 3.6 have reached end of life, 3.7 will in 3 months and 3.8 next year. Also, pythonnet 2.5 is no longer maintained. The only active development is focused on version 3+.

I would like to use ZOS-API work with modern versions of Python, 3.10+. The only pythonnet version compatible with them is 3+. Under these versions, quite a few ZOS-API calls are broken. For example, 

IZRDReaderResults.ReadNextSegmentFull

raises an exception due to how pythonnet 3+ handles the conversion of int32 and Enum between .NET<->Python.

Is there any way to use ZOS-API with these modern and maintained versions? Note that I don’t believe that using Python 3.8 or 3.9 with pythonnet 2.5.2 is a good solution, because pythonnet 2.5.2 is not actively maintained. The pythonnet team has stated multiple times that features/bugs would only be added/fixed in 3+ (for example here).

 

Thank you,

Thomas


1 reply

Yes, this needs to be fixed ASAP.

But I’m sure the Zemax SW engineers are working on this, right?

Reply