Project

General

Profile

CDO and Python on Windows

Added by Ruth Petrie over 1 year ago

Hi I am having some trouble getting CDO tools running on Windows, as shown below. I think I must be missing something fairly obviously.

Any help you can give would be appreciated.

Thanks,
Ruth

(cdo) C:\Users\Ruth>python

Python 3.6.15 (default, Dec 3 2021, 18:25:24) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

from cdo import *
cdo = Cdo()

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Ruth\.conda\envs\cdo\lib\site-packages\cdo.py", line 122, in init
self.operators = self.getOperators()
File "C:\Users\Ruth\.conda\envs\cdo\lib\site-packages\cdo.py", line 159, in getOperators
version = parse_version(getCdoVersion(self.CDO))
File "C:\Users\Ruth\.conda\envs\cdo\lib\site-packages\cdo.py", line 48, in getCdoVersion
proc = subprocess.Popen([path2cdo,'-V'],stderr = subprocess.PIPE,stdout = subprocess.PIPE)
File "C:\Users\Ruth\.conda\envs\cdo\lib\subprocess.py", line 729, in init
restore_signals, start_new_session)
File "C:\Users\Ruth\.conda\envs\cdo\lib\subprocess.py", line 1017, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified


Replies (3)

RE: CDO and Python on Windows - Added by Ralf Mueller over 1 year ago

hi Ruth!

There is no native windows binary for CDO. Which one do you use?

cheers
ralf

RE: CDO and Python on Windows - Added by Ruth Petrie over 1 year ago

Hi Ralf,

Thanks for your quick reply. That would be my mistake then as I have no binary for CDO on windows. I have a WSL running with CDO working but I have trouble with the storage and linking to network drives so I thought that the python install would run on the Windows system and I could avoid the WSL. That is clearly not right, so the only other option for windows that I have is to try the Cygwin build, so I will try that.

Thanks,
Ruth

RE: CDO and Python on Windows - Added by Ralf Mueller over 1 year ago

hi Ruth!

WSL can provide CDO, too. WSL is based on debian, which has a cdo package. apt-get install cdo should install it, see https://code.mpimet.mpg.de/projects/cdo/wiki/Win32#Windows-10 for more.

cheers
ralf

    (1-3/3)