When I run the code you showed, collision.mp4
will be saved locally and I can play it as an animation.
If you want to run the animation in jupyter environment, you need to install the following code.
# Jupyter lab
from IPython.display import HTML
%matplotlib inline
(Omission)
# plt.show()
# jupyter lab
plt.close()
HTML(anim.to_html5_video())
This is just one example of what I do. Please try this SO answer as it is very helpful.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…