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() report errors

    General Code/Help
    3
    5
    51
    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.
    • T yellow
      T yellow last edited by

      Traceback (most recent call last):
      File "C:/Users/阿斯顿/PycharmProjects/Career/pythonProject5/main.py", line 147, in <module>
      cerebro.plot()
      File "E:\apy\lib\site-packages\backtrader\cerebro.py", line 974, in plot
      from . import plot
      File "E:\apy\lib\site-packages\backtrader\plot_init_.py", line 42, in <module>
      from .plot import Plot, Plot_OldSync
      File "E:\apy\lib\site-packages\backtrader\plot\plot.py", line 44, in <module>
      from . import locator as loc
      File "E:\apy\lib\site-packages\backtrader\plot\locator.py", line 35, in <module>
      from matplotlib.dates import (HOURS_PER_DAY, MIN_PER_HOUR, SEC_PER_MIN,
      ImportError: cannot import name 'warnings' from 'matplotlib.dates' (E:\apy\lib\site-packages\matplotlib\dates.py)

      J 1 Reply Last reply Reply Quote 0
      • J
        Jonny8 @T yellow last edited by

        @T-yellow
        It would help to see you code.

        1 Reply Last reply Reply Quote 0
        • T yellow
          T yellow last edited by

          Thank you. I got it

          1 Reply Last reply Reply Quote 0
          • vladisld
            vladisld last edited by

            @T-yellow said in cerebro.plot() report errors:

            cannot import name 'warnings' from 'matplotlib.dates'

            For the benefits of community - this issue was discussed multiple times in this forum - just search for cannot import name 'warnings' from 'matplotlib.dates' and you'll get:

            https://community.backtrader.com/post/12963
            https://community.backtrader.com/post/13499
            https://community.backtrader.com/post/13339

            1 Reply Last reply Reply Quote 1
            • T yellow
              T yellow last edited by

              OK Thank you

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
              $(document).ready(function () { app.coldLoad(); }); }