Skip to content

Unable use in Notebook with ipython 9.x.x #75

@none2003

Description

@none2003

Here is the error log:

File C:\...\metrics.py:9
      7 import xxx
      8 import pandas as pd
----> 9 import quantstats_lumi as qs
     11 # import xxx
     12 from dateutil.relativedelta import relativedelta

File C:\...\.venv\Lib\site-packages\quantstats_lumi\__init__.py:31
     28 __all__ = ["stats", "plots", "reports", "utils", "extend_pandas"]
     30 # try automatic matplotlib inline
---> 31 utils._in_notebook(matplotlib_inline=True)
     34 def extend_pandas():
     35     """
     36     Extends pandas by exposing methods to be used like:
     37     df.sharpe(), df.best('day'), ...
     38     """

File C:\...\.venv\Lib\site-packages\quantstats_lumi\utils.py:300, in _in_notebook(matplotlib_inline)
    297 if shell == "ZMQInteractiveShell":
    298     # Jupyter notebook or qtconsole
    299     if matplotlib_inline:
--> 300         get_ipython().magic("matplotlib inline")
    301     return True
    302 if shell == "TerminalInteractiveShell":
    303     # Terminal running IPython

AttributeError: 'ZMQInteractiveShell' object has no attribute 'magic'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions