我正在使用pynco从 Python 脚本中运行ncks命令。尝试在函数内执行移动时报告错误nco_fl_mv()
:
$ C:/home/Anaconda3/Library/bin/ncks --dmn=lon,0,28,1 --output=C:/home/data/nclimgrid/201801_nclimgrid_dsd/work/lowres_nclimgrid_tavg_slice00.nc C:/home/data/nclimgrid/201801_nclimgrid_dsd/lowres_nclimgrid_tavg.nc
The system cannot find the path specified.
ncks: ERROR nco_fl_mv() unable to execute mv command "move C:/home/data/nclimgrid/201801_nclimgrid_dsd/work/lowres_nclimgrid_tavg_slice00.nc.pid11800.ncks.tmp C:/home/data/nclimgrid/201801_nclimgrid_dsd/work/lowres_nclimgrid_tavg_slice00.nc"
但是,该文件似乎存在:
$ ls -l C:/home/data/nclimgrid/201801_nclimgrid_dsd/work/lowres_nclimgrid_tavg_slice00.nc.pid11800.ncks.tmp
-rw-r--r-- 1 James.Adams Domain Users 2.9M Feb 9 13:45 C:/home/data/nclimgrid/201801_nclimgrid_dsd/work/lowres_nclimgrid_tavg_slice00.nc.pid11800.ncks.tmp
当我调试到 pynco 模块时,我可以看到 nco.py(第 263 行)中的 cmd 对象如下所示:
<class 'list'>: ['C:\\home\\Anaconda3\\Library\\bin\\ncks',
'--dmn=lon,0,28,1',
'--output=C:/home/data/nclimgrid/201801_nclimgrid_dsd/work/lowres_nclimgrid_tavg_slice00.nc',
`
'C:/home/data/nclimgrid/201801_nclimgrid_dsd/lowres_nclimgrid_tavg.nc']`
也许这是一个权限问题?我在 Windows 机器上使用安装在 Anaconda 上的 NCO/pynco。这发生在命令行(vanilla NCO)以及我使用 pynco NCO 包装器的脚本中。