skip to Main Content

I am having trouble installing the cdstoolbox-remote on my Linux machine (tried both Ubuntu and Debian). I installed it using pip:

pip install cdstoolbox-remote  

Which successfully installs the module, but I can’t import the module in Python. Importing the module causes the following error:

>>> import cdstoolbox
Traceback (most recent call last):  
File "<stdin>", line 1, in <module>  
File "/home/an/miniconda2/envs/tools/lib/python3.7/site-packages/cdstoolbox/__init__.py",  
line 8, in <module>  
with open(__main__.__file__) as f:  
AttributeError: module '__main__' has no attribute '__file__'  

What can be done to get it working?

2

Answers


  1. Do you really need cdstoolbox-remote? The standard API for downloading data from CDS would be cdsapi, which can be installed using

    pip install cdsapi
    

    or using conda (https://anaconda.org/conda-forge/cdsapi)

    I also just tried installing cdstoolbox-remote and got the same problem. But as it is flagged as experimental I even consider it to be possible that the current version is not a stable version.
    And cdsapi seems to work.

    Login or Signup to reply.
  2. Actually, the CDSAPI can also be used to execute workflows as follows:

    import cdsapi
     
    c = cdsapi.Client()
     
    with open("workflow.py") as f:
        code = f.read()
     
    r = c.workflow(code)
    print(c.download(r))
    

    For more, read this thread on the Copernicus services documentation.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search