This kind of errors is a version problem of mplot3d which is part of matplotlib.
Solution: First update your matplotlib/numpy to latest, then replace the entire folder 'mplot3d' in 'opticspy' folder with the one in the pip-auto-installed package. It is Jan. 24, 2025, and the solution works for my matplotlib==3.10.0/numpy==1.26.4.
The cause of these problem seems to be the change of a bunch of files of matplotlib since this project was created years ago.
One more related problem I found so far is line 89 in \ray_tracing\draw.py which should be changed to fig.canvas.manager.set_window_title('View Lens').