Forum Discussion
Can't load environment resource to notebook
- 2 years ago
Hi Anonymous
I tried to replicate your error but I was unable to.
After creating a completely new environment with a .gif and attaching that to a new notebook I was able to load the image the exact same way as you did.
Did you do anything else in the notebook before loading the .gif or did you change any other settings in your environment besides uploading the file?
If not I would advise you to try again and if the error still persists maybe contact MSFT support so they can check telemetry data on your session and environment.
BR
Martin
Hi Anonymous,
Where are the file stored? Can you please share some more detail about these? For my test scenario, I upload a gif file to the Lakehouse files folder and environment and copy the file API path and relative path to use mpimg.imread path to read it and it works well.
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import matplotlib.animation as animation
# Load the GIF file
gif_path = '/lakehouse/default/Files/Picture1.gif'
# Load the GIF file from environment
#gif_path = f"{notebookutils.nbResPath}/env/Test/Picture1.gif"
img = mpimg.imread(gif_path)
fig, ax = plt.subplots()
plt.axis("off")
im = ax.imshow(img)
plt.show(im)
If you failed to load resource, have you check if the used environment is include upload the files instead of the default environment?
Regards,
Xiaoxin Sheng