[Python] "invalid syntax" error while importing from lumibot

Discussão em 'Python' iniciado por Stack, Fevereiro 23, 2025.

  1. Stack

    Stack Membro Participativo

    I am encountering an "invalid syntax" error while trying to import from Lumibot and I have no Idea how to fix. Tried Chatgpt for finding a solution but didn't work.

    Here is my code:

    from lumibot.brokers import Alpaca
    from lumibot.strategies.strategy import Strategy
    from lumibot.traders import Trader
    from lumibot.backtesting import YahooDataBacktesting


    and here is the error:

    Traceback (most recent call last):

    File ~\anaconda3\envs\trainvenv\lib\site-packages\IPython\core\interactiveshell.py:3505 in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)

    Cell In[27], line 1
    from lumibot.brokers import Alpaca

    File ~\anaconda3\envs\trainvenv\lib\site-packages\lumibot\brokers\__init__.py:5
    from .tradier import Tradier

    File ~\anaconda3\envs\trainvenv\lib\site-packages\lumibot\brokers\tradier.py:413
    match order.status.lower():
    ^
    SyntaxError: invalid syntax

    Continue reading...

Compartilhe esta Página