Error with use WSC on fig.add_subplot(111,projection=Pj)

My code was working fine until a few days ago when I updated Astropy.

My code works correctly until this part:
pvdiagram = fits.open(‘my_PVslice11.fits’)

Pj = WCS(pvdiagram[0].header)

fig=plt.figure(figsize=(8,7))

but, I when use

ax=fig.add_subplot(111,projection=Pj)

the code mark error

Could you post the full error you are getting? Could you also provide the output of ‘print(Pj)’? Thanks!