Để chạy Matplotlib trên macOS trong virtual environment, tạo venv, kích hoạt, rồi cài dependencies.
Các bước
- Mở terminal Ubuntu/macOS.
- Cài python-venv: apt-get install python-venv (Ubuntu) hoặc macOS đã có sẵn venv module.
- Tạo môi trường: python -m venv <tên_môi_trường>.
- Kích hoạt: source <tên_môi_trường>/bin/activate.
- Cài Matplotlib và dependencies bên trong venv.
Lưu ý: Trên macOS, khuyến nghị dùng Homebrew cài Python hoặc dùng conda/miniconda để tránh vấn đề backend GUI.