I come up with the error AttributeError: 'module' object has no attribute 'imread' while using the imageio module with the following code. I searched the community a lot but all of the errors about imread command are discussed under scipy, but nothing for imageio. So, any comments or links are appreciated! Here is my code:
import os
import imageio
os.chdir('C:/concent')
png_dir='gif/'
images=[]
for file_name in os.listdir(png_dir):
if file_name.endswith('.png'):
file_path = os.path.join(png_dir, file_name)
images.append(imageio.imread(file_path))
imageio.mimsave('gif/movie.gif', images)
Probably you have another file named
imageio.pyin the working directory.The
importstatement will import files from the current directory before searching standard library and site package locations.You should be able to fix the problem by renaming your local
imageio.pyfile to something else that does not clash with other modules.