Damn, that is so annoying! "Great" job guys!
Apparently, we can´t use cdstoolbox with other libraries, as keywords seem to be reserved?
For instance, whenever using
import csv
import cdstoolbox as ct
csv_paths = r"FC_centroids.csv"
with open(csv_paths) as csv_file:
csv_reader = csv.reader(csv_file, delimiter=';')
import pandas as pd
import cdstoolbox as ct
csv_paths = r"FC_centroids.csv"
df = pd.read_csv(csv_paths, delimiter=";")
2020-10-13 15:43:41,673 ERROR Reason: Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/jsonrequest/requests.py", line 71, in jsonrequestcall
resp = coding.encode(req.callable(*req.args, **req.kwargs), register=encoders, **context)
File "/usr/local/lib/python3.6/dist-packages/cdsworkflows/submit_workflow.py", line 18, in submit_workflow
workflow_bare_func = runpy.run_path(workflow_path)[workflow_name]
File "/usr/lib/python3.6/runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "/usr/lib/python3.6/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/workflows/internal/code/70826f6d6571edb3b9362fac994d9f2a8031e42dff6b0a61fefed78c/workflows.py", line 8, in <module>
df = pd.read_csv(csv_paths, delimiter=";")
File "/usr/local/lib/python3.6/dist-packages/pandas/io/parsers.py", line 685, in parser_f
return _read(filepath_or_buffer, kwds)
File "/usr/local/lib/python3.6/dist-packages/pandas/io/parsers.py", line 457, in _read
parser = TextFileReader(fp_or_buf, **kwds)
File "/usr/local/lib/python3.6/dist-packages/pandas/io/parsers.py", line 895, in __init__
self._make_engine(self.engine)
File "/usr/local/lib/python3.6/dist-packages/pandas/io/parsers.py", line 1135, in _make_engine
self._engine = CParserWrapper(self.f, **self.options)
File "/usr/local/lib/python3.6/dist-packages/pandas/io/parsers.py", line 1917, in __init__
self._reader = parsers.TextReader(src, **kwds)
File "pandas/_libs/parsers.pyx", line 382, in pandas._libs.parsers.TextReader.__cinit__
File "pandas/_libs/parsers.pyx", line 689, in pandas._libs.parsers.TextReader._setup_parser_source
FileNotFoundError: [Errno 2] File b'FC_centroids.csv' does not exist: b'FC_centroids.csv'
2020-10-13 15:43:41,673 ERROR Traceback (most recent call last):
2020-10-13 15:43:41,673 ERROR File "/opt/cdstoolbox/cdscompute/cdscompute/cdshandlers/services/handler.py", line 49, in handle_request
2020-10-13 15:43:41,674 ERROR result = cached(context.method, proc, context, context.args, context.kwargs)
2020-10-13 15:43:41,674 ERROR File "/opt/cdstoolbox/cdscompute/cdscompute/caching.py", line 108, in cached
2020-10-13 15:43:41,674 ERROR result = proc(context, *context.args, **context.kwargs)
2020-10-13 15:43:41,674 ERROR File "/opt/cdstoolbox/cdscompute/cdscompute/services.py", line 118, in __call__
2020-10-13 15:43:41,674 ERROR return p(*args, **kwargs)
2020-10-13 15:43:41,674 ERROR File "/opt/cdstoolbox/cdscompute/cdscompute/services.py", line 59, in __call__
2020-10-13 15:43:41,675 ERROR return self.proc(context, *args, **kwargs)
2020-10-13 15:43:41,675 ERROR File "/home/cds/cdsservices/services/run_workflow.py", line 36, in execute
2020-10-13 15:43:41,675 ERROR raise exceptions.CDSException(True, True, logging + traceback, '', uri)
2020-10-13 15:43:41,675 ERROR cdsclient.exceptions.CDSException: Traceback (most recent call last):
2020-10-13 15:43:41,675 ERROR File "/usr/local/lib/python3.6/dist-packages/jsonrequest/requests.py", line 71, in jsonrequestcall
2020-10-13 15:43:41,676 ERROR resp = coding.encode(req.callable(*req.args, **req.kwargs), register=encoders, **context)
2020-10-13 15:43:41,676 ERROR File "/usr/local/lib/python3.6/dist-packages/cdsworkflows/submit_workflow.py", line 18, in submit_workflow
2020-10-13 15:43:41,676 ERROR workflow_bare_func = runpy.run_path(workflow_path)[workflow_name]
2020-10-13 15:43:41,676 ERROR File "/usr/lib/python3.6/runpy.py", line 263, in run_path
2020-10-13 15:43:41,676 ERROR pkg_name=pkg_name, script_name=fname)
2020-10-13 15:43:41,676 ERROR File "/usr/lib/python3.6/runpy.py", line 96, in _run_module_code
2020-10-13 15:43:41,676 ERROR mod_name, mod_spec, pkg_name, script_name)
2020-10-13 15:43:41,677 ERROR File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
2020-10-13 15:43:41,677 ERROR exec(code, run_globals)
2020-10-13 15:43:41,677 ERROR File "/workflows/internal/code/70826f6d6571edb3b9362fac994d9f2a8031e42dff6b0a61fefed78c/workflows.py", line 8, in <module>
2020-10-13 15:43:41,677 ERROR df = pd.read_csv(csv_paths, delimiter=";")
2020-10-13 15:43:41,677 ERROR File "/usr/local/lib/python3.6/dist-packages/pandas/io/parsers.py", line 685, in parser_f
2020-10-13 15:43:41,677 ERROR return _read(filepath_or_buffer, kwds)
2020-10-13 15:43:41,677 ERROR File "/usr/local/lib/python3.6/dist-packages/pandas/io/parsers.py", line 457, in _read
2020-10-13 15:43:41,678 ERROR parser = TextFileReader(fp_or_buf, **kwds)
2020-10-13 15:43:41,678 ERROR File "/usr/local/lib/python3.6/dist-packages/pandas/io/parsers.py", line 895, in __init__
2020-10-13 15:43:41,678 ERROR self._make_engine(self.engine)
2020-10-13 15:43:41,678 ERROR File "/usr/local/lib/python3.6/dist-packages/pandas/io/parsers.py", line 1135, in _make_engine
2020-10-13 15:43:41,678 ERROR self._engine = CParserWrapper(self.f, **self.options)
2020-10-13 15:43:41,678 ERROR File "/usr/local/lib/python3.6/dist-packages/pandas/io/parsers.py", line 1917, in __init__
2020-10-13 15:43:41,678 ERROR self._reader = parsers.TextReader(src, **kwds)
2020-10-13 15:43:41,679 ERROR File "pandas/_libs/parsers.pyx", line 382, in pandas._libs.parsers.TextReader.__cinit__
2020-10-13 15:43:41,679 ERROR File "pandas/_libs/parsers.pyx", line 689, in pandas._libs.parsers.TextReader._setup_parser_source
2020-10-13 15:43:41,679 ERROR FileNotFoundError: [Errno 2] File b'FC_centroids.csv' does not exist: b'FC_centroids.csv'
Traceback (most recent call last):
File "C:/Geocledian/PYTHON/DeepLearning/COPERNICUS_DATA/asd.py", line 2, in <module>
import cdstoolbox as ct
File "C:\Python37\lib\site-packages\cdstoolbox\__init__.py", line 11, in <module>
print(c.download(c.workflow(code)))
File "C:\Python37\lib\site-packages\cdsapi\api.py", line 356, in workflow
return self.service("tool.toolbox.orchestrator.run_workflow", params)
File "C:\Python37\lib\site-packages\cdsapi\api.py", line 347, in service
result = self._api('%s/tasks/services/%s/clientid-%s' % (self.url, name, uuid.uuid4().hex), request, 'PUT')
File "C:\Python37\lib\site-packages\cdsapi\api.py", line 480, in _api
raise Exception("%s. %s." % (reply['error'].get('message'), reply['error'].get('reason')))
Exception: . Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/jsonrequest/requests.py", line 71, in jsonrequestcall
resp = coding.encode(req.callable(*req.args, **req.kwargs), register=encoders, **context)
File "/usr/local/lib/python3.6/dist-packages/cdsworkflows/submit_workflow.py", line 18, in submit_workflow
workflow_bare_func = runpy.run_path(workflow_path)[workflow_name]
File "/usr/lib/python3.6/runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "/usr/lib/python3.6/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/workflows/internal/code/70826f6d6571edb3b9362fac994d9f2a8031e42dff6b0a61fefed78c/workflows.py", line 8, in <module>
df = pd.read_csv(csv_paths, delimiter=";")
File "/usr/local/lib/python3.6/dist-packages/pandas/io/parsers.py", line 685, in parser_f
return _read(filepath_or_buffer, kwds)
File "/usr/local/lib/python3.6/dist-packages/pandas/io/parsers.py", line 457, in _read
parser = TextFileReader(fp_or_buf, **kwds)
File "/usr/local/lib/python3.6/dist-packages/pandas/io/parsers.py", line 895, in __init__
self._make_engine(self.engine)
File "/usr/local/lib/python3.6/dist-packages/pandas/io/parsers.py", line 1135, in _make_engine
self._engine = CParserWrapper(self.f, **self.options)
File "/usr/local/lib/python3.6/dist-packages/pandas/io/parsers.py", line 1917, in __init__
self._reader = parsers.TextReader(src, **kwds)
File "pandas/_libs/parsers.pyx", line 382, in pandas._libs.parsers.TextReader.__cinit__
File "pandas/_libs/parsers.pyx", line 689, in pandas._libs.parsers.TextReader._setup_parser_source
FileNotFoundError: [Errno 2] File b'FC_centroids.csv' does not exist: b'FC_centroids.csv'
1 Comment
Kevin Marsh
Hi Dino,
Where are you running your workflow? is it in the CDS Toolbox?
Thanks,
Kevin