microsoft / microsoft/qlib

Can't execute workflow example

Open
#1,703 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
48.7k
Forks
7.7k
PR merge metrics
No merged PRs in 30d

Description

Hi, I got below error by executing the example workflow in the readme. I am using python 3.8.18. Could you help with it?

(qlib) D:\Work\workspace\qlib\examples>qrun benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
Traceback (most recent call last):
File "D:\Work\anaconda3\envs\qlib\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "D:\Work\anaconda3\envs\qlib\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "D:\Work\anaconda3\envs\qlib\Scripts\qrun.exe_main
.py", line 7, in
File "D:\Work\anaconda3\envs\qlib\lib\site-packages\qlib\workflow\cli.py", line 115, in run
fire.Fire(workflow)
File "D:\Work\anaconda3\envs\qlib\lib\site-packages\fire\core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "D:\Work\anaconda3\envs\qlib\lib\site-packages\fire\core.py", line 475, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "D:\Work\anaconda3\envs\qlib\lib\site-packages\fire\core.py", line 691, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "D:\Work\anaconda3\envs\qlib\lib\site-packages\qlib\workflow\cli.py", line 71, in workflow
config = yaml.safe_load(fp)
File "D:\Work\anaconda3\envs\qlib\lib\site-packages\ruamel\yaml\main.py", line 1105, in safe_load
error_deprecation('safe_load', 'load', arg="typ='safe', pure=True")
File "D:\Work\anaconda3\envs\qlib\lib\site-packages\ruamel\yaml\main.py", line 1037, in error_deprecation
raise AttributeError(s)
AttributeError:
"safe_load()" has been removed, use

yaml = YAML(typ='safe', pure=True)
yaml.load(...)

instead of file "D:\Work\anaconda3\envs\qlib\lib\site-packages\qlib\workflow\cli.py", line 71

    config = yaml.safe_load(fp)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with qlib/workflow/cli.py at line 71 and the README workflow example that runs qrun benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml. Reproduce the failure with the reported Python environment, inspect the ruamel.yaml safe_load compatibility error, and verify that the example workflow executes successfully afterward.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.