As stated in the comments above, this is just a warning and your code should not stop here. If it's OK to show an empty plot in this case and you just want to suppress the warning you can do it as follows:
import matplotlib.pyplot as plt
import warnings
with warnings.catch_warnings():
warnings.filterwarnings("ignore", message="No contour levels were found within the data range.")
plt.contour([[1,1],[1,1]])
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…