[Python] Lean CLI does not show "backtest" command after installation

Discussão em 'Python' iniciado por Stack, Setembro 6, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to install Lean CLI on Windows 10 inside a virtual environment (venv), but after installation I do not see the backtest command.

    Here are the exact steps I did:


    1. Created and activated a virtual environment:

      python -m venv venv
      venv\Scripts\activate

    2. Installed Lean CLI:

      pip install lean

    3. Verified installation:

      lean --help

    But I only get:

    Usage: lean [OPTIONS] COMMAND [ARGS]...

    Options:
    --version Show the version and exit.
    --help Show this message and exit.

    Commands:
    create-project Create a new project containing starter code.
    init Bootstrap a Lean CLI project.
    login Log in with a QuantConnect account.
    logout Log out and remove stored credentials.


    There is no backtest command at all.

    I tried:


    • Upgrading pip and reinstalling Lean (pip install --upgrade lean)


    • Installing directly from GitHub (pip install git+https://github.com/QuantConnect/Lean.git)


    • Installing .NET SDK and trying dotnet tool install --global QuantConnect.Lean.CLI but got quantconnect.lean.cli is not found in NuGet feeds.

    Question:
    How can I correctly install Lean CLI with latest version so that I can run lean backtest "MyStrategy" locally on Windows?

    Note: The version i getted was 0.1.2 (It is verrrry old ) && i use powershell ***

    Any help would be appreciated!

    Continue reading...

Compartilhe esta Página