quantstats icon indicating copy to clipboard operation
quantstats copied to clipboard

Jupyter import issue: `magic(...)` is deprecated

Open svendaj opened this issue 1 year ago • 2 comments

Hi @ranaroussi , you are doing fantastic job (using also your yfinance). I have issue with importing QuantStats to Kaggle notebooks (IPython version 8.20.0). pip install is successful, but when

import quantstats as qs

line 300 of qs.utils throws:

File /opt/conda/lib/python3.10/site-packages/quantstats/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":

and fails with

DeprecationWarning: `magic(...)` is deprecated since IPython 0.13 (warning added in 8.1), use run_line_magic(magic_name, parameter_s).

svendaj avatar Mar 31 '24 21:03 svendaj

Check out https://github.com/Lumiwealth/quantstats_lumi, which is being updated regularly. We are a fork of this library that is being maintained by Lumiwealth

grzesir avatar Jul 30 '24 06:07 grzesir