簡體   English   中英

OSError:沒有這樣的文件或目錄

[英]OSError: No such file or directory

當我嘗試打開.h5文件時,它顯示以下錯誤

 Traceback (most recent call last): File "C:\\Users\\VW3ZTWS\\PycharmProjects\\Data_Collection_and_learnings\\venv\\lib\\site-packages\\IPython\\core\\interactiveshell.py", line 2869, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-10-524e5789c66b>", line 6, in <module> f = h5py.File(filename, 'r+') File "C:\\Users\\VW3ZTWS\\PycharmProjects\\Data_Collection_and_learnings\\venv\\lib\\site-packages\\h5py\\_hl\\files.py", line 394, in __init__ swmr=swmr) File "C:\\Users\\VW3ZTWS\\PycharmProjects\\Data_Collection_and_learnings\\venv\\lib\\site-packages\\h5py\\_hl\\files.py", line 172, in make_fid fid = h5f.open(name, h5f.ACC_RDWR, fapl=fapl) File "h5py\\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py\\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "h5py\\h5f.pyx", line 85, in h5py.h5f.open OSError: Unable to open file (unable to open file: name = '28ggv-016.h5.h5', errno = 2, error message = 'No such file or directory', flags = 1, o_flags = 2) 

我使用的代碼:

import h5py
import numpy as np
import pandas as pd
filename = '28ggv-016.h5'
f = h5py.File(filename, 'r')

Ctrl + Shift + C復制文件的完整路徑,並將其粘貼到filename

import h5py
import numpy as np
import pandas as pd
filename = 'dir:\your\path\to\the\file\28ggv-016.h5'
f = h5py.File(filename, 'r')

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM