ModuleNotFoundError: No module named 'matplotlib_inline'
- 1. `ModuleNotFoundError: No module named 'matplotlib_inline'`
- 2. matplotlib-inline
- References
如果你在普通的 Python 腳本或命令行中運行代碼,那么不需要 matplotlib_inline,因為普通的 Python 環境不需要這個庫來顯示 matplotlib 圖表。
1. ModuleNotFoundError: No module named 'matplotlib_inline'
Traceback (most recent call last):File "/home/yongqiang/stable_diffusion_work/stable_diffusion_diffusers/yongqiang.py", line 8, in <module>from matplotlib_inline import backend_inline
ModuleNotFoundError: No module named 'matplotlib_inline'
2. matplotlib-inline
https://pypi.org/project/matplotlib-inline/
Matplotlib Inline Back-end for IPython and Jupyter
This package provides support for matplotlib to display figures directly inline in the Jupyter notebook and related clients.
Note that in current versions of JupyterLab and Jupyter Notebook, the explicit use of the %matplotlib inline
directive is not needed anymore, though other third-party clients may still require it.
請注意,在 JupyterLab 和 Jupyter Notebook 的當前版本中,不再需要明確使用 %matplotlib inline
指令,但其他第三方客戶端可能仍需要它。
pip install matplotlib-inline
(base) yongqiang@yongqiang:~$ pip install matplotlib-inline
Collecting matplotlib-inlineDownloading matplotlib_inline-0.1.7-py3-none-any.whl (9.9 kB)
Collecting traitlets (from matplotlib-inline)Downloading traitlets-5.14.3-py3-none-any.whl (85 kB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 85.4/85.4 kB 147.0 kB/s eta 0:00:00
Installing collected packages: traitlets, matplotlib-inline
Successfully installed matplotlib-inline-0.1.7 traitlets-5.14.3
(base) yongqiang@yongqiang:~$
References
[1] Yongqiang Cheng, https://yongqiang.blog.csdn.net/