我有一些数据需要使用ytree加载,可以通过以下方式完成:
import ytree
a = ytree.load('ctrees.h5')
但是,这样做会产生以下错误:
OSError: file does not exist: ctrees.h5.
使用回溯:
Traceback (most recent call last):
File "C:\Users\Documents\untitled1.py", line 3, in <module>
a = ytree.load('ctrees.h5')
File "C:\Users\anaconda3\lib\site-packages\ytree\data_structures\arbor.py", line 1089, in load
raise IOError("file does not exist: %s." % filename)
OSError: file does not exist: ctrees.h5.
如果我尝试a=ytree.load(“ctrees.h5”),也会发生同样的情况。我可以看到该文件存在,我已将工作目录更改为正确的目录,并且我的脚本保存在同一目录中。我还尝试毫无乐趣地指定文件的完整路径。 我在Windows10上使用Python3.7和Ytree2.3
谢谢你的帮助
编辑(已解决): 通过在脚本顶部指定路径并将文件读取为,修复了此问题:
PATH='C:\\path\\to\\file\\directory\\'
a = ytree.load(PATH + "ctrees.h5")
目前没有回答
相关问题 更多 >
编程相关推荐