clstoulouse / motu-client-python

Motu is a high efficient and robust Web Server which fills the gap between heterogeneous data providers to end users. Motu handles, extracts and transforms oceanographic huge volumes of data without performance collapse. This client enables to extract and download data through a python command line.
GNU Lesser General Public License v3.0
49 stars 22 forks source link

motu client and python script for Copernicus Marine Service #33

Closed AOceanA closed 1 year ago

AOceanA commented 1 year ago

Hi, I'm trying to download some data using the Motu client in a python script. I keep getting the same error , which states "No module named motuclient.main; 'motuclient' is a package and cannot be directly executed"

Command in python is:

query = f'python -m motuclient --motu https://my.cmems-du.eu/motu-web/Motu \ --service-id {serviceID}-TDS --product-id {productID} \ --longitude-min {lon[0]} --longitude-max {lon[1]} --latitude-min {lat[0]} --latitude-max {lat[1]}\ --date-min "{start_date}" --date-max "{start_date+delta_t}" \ {var} \ --out-dir {out_dir} --out-name {out_name} --user {USERNAME} --pwd {PASSWORD}'

Following a similar question from before, I type: motuclient -h which gives: ""Traceback (most recent call last): File "/Users/AOceanA/opt/anaconda3/bin/motuclient", line 5, in from motuclient import main ImportError: cannot import name 'main' from 'motuclient' (/Users/AOceanA/opt/anaconda3/lib/python3.9/site-packages/motuclient/init.py)""

When I open this init file ("2xunderscore init 2xunderscore.py", it is empty.

I am new to python and couldn't figure out what the problem is. Everything seems to respond except the motuclient. I'm using Python 3.9.13. I installed motuclient using pip. I wonder if this is a version problem, or I'm missing something else. Would appreciate some suggestion. Cheers