Skip to content

Lean CLI: Error: Invalid value for '--data-provider-historical': 'Local' is not one of . (Cannot Run Any Backtest) #571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Bluesoul111 opened this issue May 21, 2025 · 0 comments

Comments

@Bluesoul111
Copy link

Hello QuantConnect Team,

I am experiencing a persistent error with the Lean CLI on Windows when running any backtest (e.g., lean backtest .). The error is:

Error: Invalid value for '--data-provider-historical': 'Local' is not one of .

What I have already tried:

  • No lean.json in my project, workspace, or user profile directory.
  • No .lean or .lean-cli hidden folders anywhere.
  • No "data-provider-historical" entry in any config.json.
  • No relevant environment variables (Get-ChildItem Env: | Where-Object { $_.Name -like "*LEAN*" } returns nothing).
  • No global config files in %APPDATA%, AppData\Roaming, or AppData\Local.
  • Never used pipx to install Lean.
  • Fully uninstalled and reinstalled Lean CLI (pip uninstall lean -y and pip install lean), now running version 1.0.218.
  • Ran lean config reset.
  • Started a completely new project with lean create-project, but the error still appears.
  • All commands are run with no extra flags, just lean backtest . or lean backtest Algorithm.
  • Purged all possible config, cache, and hidden files from user, appdata, and project directories.
  • Checked the registry for Lean-related keys (none found).
  • Cleaned Python site-packages of any lean* or quantconnect* folders.
  • Reinstalled Lean CLI in a new virtual environment.
  • Tried running in a new temp directory with a fresh project.
  • Tried running with LEAN_DEBUG=1 and --verbose (no extra debug output).
  • Tried downgrading Lean CLI to earlier versions.
  • Tried on a clean Docker image.

System Info:

  • OS: Windows
  • Python: (Anaconda, 3.9, venv: lean-env)
  • Lean CLI: 1.0.218
  • Default shell: PowerShell

The error persists in all cases, even with a clean environment and new project.
It appears that the CLI is injecting 'Local' for --data-provider-historical internally, and no valid providers are registered.

Please advise:

  • Is there any hidden global state, cache, or registry entry that could cause this?
  • Is this a known bug in the current CLI?
  • How can I fully reset or repair the CLI so that it uses the default data provider and allows local backtests to run?

Thank you for your help!


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant