0

我想通过 Python 3.6 在 Windows 10 中使用气候数据运算符 (CDO)。conda install -c conda-forge cdo我已经在 Anaconda Prompt 中安装了 CDO 。然后我在 Jupyter 笔记本中使用 from 调用它cdo import *。但是当我使用时cdo = Cdo(),它会抛出错误。如果有人能指导我在 Windows 10 中安装的 python 3.6 中使用 CDO,那将有很大帮助。以下是错误报告

FileNotFoundError                         Traceback (most recent call last)
<ipython-input-2-ab9423485a93> in <module>()
----> 1 cdo=Cdo()

~\Anaconda3\lib\site-packages\cdo.py in __init__(self, returnCdf, returnNoneOnError, forceOutput, cdfMod, env, debug, tempdir, logging, logFile)
    120       self.CDO = 'cdo'
    121 
--> 122     self.operators              = self.getOperators()
    123     self.noOutputOperators      = [op for op in self.operators.keys() if 0 == self.operators[op]]
    124     self.returnCdf              = returnCdf

~\Anaconda3\lib\site-packages\cdo.py in getOperators(self)
    157     operators = {}
    158 
--> 159     version = parse_version(getCdoVersion(self.CDO))
    160     if (version < parse_version('1.7.2')):
    161       proc = subprocess.Popen([self.CDO,'-h'],stderr = subprocess.PIPE,stdout = subprocess.PIPE)

~\Anaconda3\lib\site-packages\cdo.py in getCdoVersion(path2cdo, verbose)
     46 
     47 def getCdoVersion(path2cdo,verbose=False):
---> 48   proc = subprocess.Popen([path2cdo,'-V'],stderr = subprocess.PIPE,stdout = subprocess.PIPE)
     49   ret  = proc.communicate()
     50   cdo_help   = ret[1].decode("utf-8")

~\Anaconda3\lib\subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors)
    707                                 c2pread, c2pwrite,
    708                                 errread, errwrite,
--> 709                                 restore_signals, start_new_session)
    710         except:
    711             # Cleanup if the child failed starting.

~\Anaconda3\lib\subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_start_new_session)
    995                                          env,
    996                                          os.fspath(cwd) if cwd is not None else None,
--> 997                                          startupinfo)
    998             finally:
    999                 # Child is launched. Close the parent's copy of those pipe

FileNotFoundError: [WinError 2] The system cannot find the file specified
4

0 回答 0