Matplotlib 是 Python 中常用的科学绘图库,安装前请确保已正确配置 Python 环境。以下是常见安装方式:
1. 🐍 使用 pip 安装
pip install matplotlib
2. 🐱 使用 conda 安装
conda install -c conda-forge matplotlib
3. 📦 从源码编译安装
git clone https://github.com/matplotlib/matplotlib.git
cd matplotlib
python setup.py install
📌 注意事项
- 安装前建议升级 pip:
pip install --upgrade pip
- 若遇到依赖问题,可参考Matplotlib官方文档排查
更多安装选项请参考Matplotlib官方文档 👉