如何在python中加载.mrc文件?

时间:2017-04-08 16:49:45

标签: python-2.7 file ioerror

我正在尝试在python中加载.mrc文件。但是,我收到了错误。

码(ReadMrcTest.py)::

import numpy as np
import h5py

imgPath = 'usr/Task1/emd-62.mrc' #Even for 'usr/task1/emd-62.mrc', same error
image = h5py.File(imgPath)
print image

错误:

Traceback (most recent call last):
  File "ReadMrcTest.py", line 8, in <module> 
    image = h5py.File(imgPath) 
  File "/usr/s029/.local/lib/python2.7/site-packages/h5py/_hl/files.py", line 271, in __init__
    fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
  File "/usr/s029/.local/lib/python2.7/site-packages/h5py/_hl/files.py", line 126, in make_fid
    fid = h5f.create(name, h5f.ACC_EXCL, fapl=fapl, fcpl=fcpl)
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/tmp/pip-nCYoKW-build/h5py/_objects.c:2840)
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/tmp/pip-nCYoKW-build/h5py/_objects.c:2798)
  File "h5py/h5f.pyx", line 98, in h5py.h5f.create (/tmp/pip-nCYoKW-build/h5py/h5f.c:2284)
**IOError: Unable to create file (Unable to open file: name = '/usr/task1/emd-62.mrc', errno = 17, error message = 'file exists', flags = 15, o_flags = c2)**

提前致谢

0 个答案:

没有答案