Project

General

Profile

Cdo in Python, Windows

Added by Andrew Dunningham over 5 years ago

I'm running Python 3.7 (Anaconda: Anaconda3-5.3.1-Windows-x86_64.exe), Windows 10 64 bit

I have cdo package 1.4.0 installed, via pip

I'm getting the error below with the code:

from cdo import Cdo
from os import *
from os.path import *

from netCDF4 import *
from numpy import * #
cdo = Cdo() < Line 8

--- Error ---
C:\ProgramData\Anaconda3\python.exe D:/Rangitaiki/Python/ProcesstoOnefile-CDO.py
Could not load xarray
Traceback (most recent call last):
File "D:/Rangitaiki/Python/ProcesstoOnefile-CDO.py", line 8, in <module>
cdo = Cdo()
File "C:\ProgramData\Anaconda3\lib\site-packages\cdo.py", line 147, in init
signal.siginterrupt(signal.SIGINT, False)
AttributeError: module 'signal' has no attribute 'siginterrupt'

Process finished with exit code 1

If anyone can help?


Replies (3)

RE: Cdo in Python, Windows - Added by Ralf Mueller over 5 years ago

I encountered this using cygwin - removing the import of xarray solved it for me.

BTW: What binary do you use? You seem to call a native python on windows and there is none available regarding CDO ... at least I guess ;-)

cheers
ralf

RE: Cdo in Python, Windows - Added by Andrew Dunningham over 5 years ago

Ralf
Thanks very much

I did think that cdo python worked in native windows but found this:
--------
hi!
Currently the only windows binary is the pre-build cygwin package in the download area.

conda only provides linux and macos - based packages at the moment.

--------
back to bash :-)

Perhaps a note to that effect on the https://code.mpimet.mpg.de/projects/cdo/wiki/Cdo%7Brbpy%7D page :-)

Regards
Andy

RE: Cdo in Python, Windows - Added by Ralf Mueller over 5 years ago

Thanks for the hin, Andy. It was time for an update, indeed. hope it's more clear now. I also updated the Win32 page a bit.

cheers
ralf

    (1-3/3)