Every time I run the notebook locally it gives me this error:
NameError Traceback (most recent call last)
File c:\Users\Youssouf El-Gammal\AppData\Local\Programs\Python\Python311\Lib\site-packages\ipywidgets\widgets\interaction.py:239, in interactive.update(self, *args)
237 value = widget.get_interact_value()
238 self.kwargs[widget._kwarg] = value
→ 239 self.result = self.f(**self.kwargs)
240 show_inline_matplotlib_plots()
241 if self.auto_display and self.result is not None:
File c:\Users\Youssouf El-Gammal\Desktop\Machine-Learning-Specialization\C3_Unsupervised Learning_Recommenders_Reinforcement Learning\Week2\PCA_OptionalLab\pca_utils.py:285, in plot_widget..update(angle)
283 def update(angle):
284 ang = angle
→ 285 with fig.batch_update():
286 p0r = rotation_matrix(ang)@p0
287 p1r = rotation_matrix(ang)@p1
NameError: cannot access free variable ‘fig’ where it is not associated with a value in enclosing scope