首页 > 解决方案 > OSError 无法创建文件(无法打开 .mat 文件,errno = 17,错误消息 = '文件存在',标志 = 15,o_flags = 502)

问题描述

我想阅读这个 .mat 文件(https://www.kaggle.com/crawford/deepsat-sat6)并希望将其可视化/转换为 jpg 中的图像。请参考下面的代码和错误。请帮助我克服错误。

import matplotlib.pyplot as plt
import numpy as np
import h5py
from PIL import Image
filepath = 'D:\deepsat-sat6\sat-6-full.mat'
H5PY_DEFAULT_READONLY=1
f = h5py.File(filepath, 'r') #to open .mat file for reading

OSError: Unable to create file (unable to open file: name = 'D:\deepsat-sat6\sat-6-full.mat', errno = 17, error message = 'File exists', flags = 15, o_flags = 502)

标签: pythonimagejupyter-notebookh5pyanaconda3

解决方案


推荐阅读