Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

    cerebro.plot() error!!!

    General Code/Help
    2
    4
    1229
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • MuSaCN
      MuSaCN last edited by

      I want to use Backtrader on Python IDE ,not with anaconda, not in jupyter.
      every is ok, only cerebro.plot() get error.
      It raise : AttributeError: 'NoneType' object has no attribute 'session'.
      how to solve it ?

      1 Reply Last reply Reply Quote 0
      • B
        backtrader administrators last edited by

        The first thing for anyone to be able to offer any diagnostic is that people know what you are doing and what the error looks like. And the best approach to achieve that is to have a small code snippet, small data sample to reproduce the error.

        @MuSaCN said in cerebro.plot() error!!!:

        every is ok

        That's your assumption. It may simply not be the case.

        1 Reply Last reply Reply Quote 1
        • MuSaCN
          MuSaCN last edited by

          I found out where the error is:
          matplotlib's backend must set to "TkAgg".

          cerebro.plot(iplot= True) will set backend to "nbAgg".

          B 1 Reply Last reply Reply Quote 0
          • B
            backtrader administrators @MuSaCN last edited by

            Glad you solved the problem, but as it is often the case, any kind of help or diagnostic is impossible if you say

            @MuSaCN said in cerebro.plot() error!!!:

            I want to use Backtrader on Python IDE ,not with anaconda, not in jupyter.
            every is ok, only cerebro.plot() get error.

            but you are really doing something different.

            @MuSaCN said in cerebro.plot() error!!!:

            cerebro.plot(iplot= True) will set backend to "nbAgg".

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors