Skip to content

nces file not found on windows #82

@tch521

Description

@tch521

Installed using conda forge, but any attempt to use nces fails, i.e.

nco = Nco()
local_file1 = "./local_file1.nc"  # existing file with "precipitation" variable
local_file2 = "./local_file2.nc"  # existing file with "precipitation" variable
local_file3 = "./local_file3.nc"  # not an existing file
print(nco.ncks(input=local_file1, options=["-M"]).decode())  # this works fine
nco.nces(input=[local_file1, local_file2], output=local_file3, options=["-y ttl", "-v precipitation"])  # this fails 
# [WinError 2] The system cannot find the file specified

Took me a long time to figure out that this is because nces.exe doesn't exist on windows when pynco is installed via conda. However you can create it yourself by making a cope of ncra.exe and renaming it to nces.exe - I can't remember where I found this solution (it was some months ago).

Also, attempting to replace nces with ncra in the python code does not work - the reasons why are beyond me. But clearly the simple solution here is to tweak the conda recipe to include an nces.exe file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions