Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. ch4r0n
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
    C
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 1
    • Best 1
    • Groups 0

    ch4r0n

    @ch4r0n

    2
    Reputation
    5
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    ch4r0n Unfollow Follow

    Best posts made by ch4r0n

    • RE: ImportError: cannot import name MIN_PER_HOUR - when trying to plot

      the error is in here

        File "/Users/ch4r0n/.pyenv/versions/3.7.5/lib/python3.7/site-packages/backtrader/plot/plot.py", line 44, in <module>
          from . import locator as loc
        File "/Users/ch4r0n/.pyenv/versions/3.7.5/lib/python3.7/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' (/Users/ch4r0n/.pyenv/versions/3.7.5/lib/python3.7/site-packages/matplotlib/dates.py)
      

      backtrader/plot/locator.py

      from matplotlib.dates import (HOURS_PER_DAY, MIN_PER_HOUR, SEC_PER_MIN,
                                    MONTHS_PER_YEAR, DAYS_PER_WEEK,
                                    SEC_PER_HOUR, SEC_PER_DAY,
                                    num2date, rrulewrapper, YearLocator,
                                    MicrosecondLocator, warnings)
      

      The 'warnings' modules has been remove in the matplotlib3.3.0
      so you should delete it warnings

      from matplotlib.dates import (HOURS_PER_DAY, MIN_PER_HOUR, SEC_PER_MIN,
                                    MONTHS_PER_YEAR, DAYS_PER_WEEK,
                                    SEC_PER_HOUR, SEC_PER_DAY,
                                    num2date, rrulewrapper, YearLocator,
                                    MicrosecondLocator)
      

      it worked!

      posted in General Code/Help
      C
      ch4r0n

    Latest posts made by ch4r0n

    • RE: ImportError: cannot import name MIN_PER_HOUR - when trying to plot

      the error is in here

        File "/Users/ch4r0n/.pyenv/versions/3.7.5/lib/python3.7/site-packages/backtrader/plot/plot.py", line 44, in <module>
          from . import locator as loc
        File "/Users/ch4r0n/.pyenv/versions/3.7.5/lib/python3.7/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' (/Users/ch4r0n/.pyenv/versions/3.7.5/lib/python3.7/site-packages/matplotlib/dates.py)
      

      backtrader/plot/locator.py

      from matplotlib.dates import (HOURS_PER_DAY, MIN_PER_HOUR, SEC_PER_MIN,
                                    MONTHS_PER_YEAR, DAYS_PER_WEEK,
                                    SEC_PER_HOUR, SEC_PER_DAY,
                                    num2date, rrulewrapper, YearLocator,
                                    MicrosecondLocator, warnings)
      

      The 'warnings' modules has been remove in the matplotlib3.3.0
      so you should delete it warnings

      from matplotlib.dates import (HOURS_PER_DAY, MIN_PER_HOUR, SEC_PER_MIN,
                                    MONTHS_PER_YEAR, DAYS_PER_WEEK,
                                    SEC_PER_HOUR, SEC_PER_DAY,
                                    num2date, rrulewrapper, YearLocator,
                                    MicrosecondLocator)
      

      it worked!

      posted in General Code/Help
      C
      ch4r0n