How to install Matplotlib without installing Qt using Conda on Windows?

When installing Matplotlib with Conda on Windows, you might want to avoid the heavy Qt dependency for certain applications. The matplotlib-base package provides core functionality without Qt widgets, making it lighter and faster to install.

Why Install matplotlib-base?

The standard matplotlib package includes Qt dependencies for interactive backends, which can be large and unnecessary for server applications or basic plotting. The matplotlib-base package includes:

  • Core plotting functionality
  • Non-interactive backends (PNG, PDF, SVG)
  • Smaller installation size
  • Faster installation time

Installation Commands

Use any of these conda-forge commands to install matplotlib-base without Qt ?

conda install -c conda-forge matplotlib-base
conda install -c conda-forge/label/testing matplotlib-base
conda install -c conda-forge/label/testing/gcc7 matplotlib-base
conda install -c conda-forge/label/cf202003 matplotlib-base
conda install -c conda-forge/label/matplotlib_rc matplotlib-base
conda install -c conda-forge/label/gcc7 matplotlib-base
conda install -c conda-forge/label/broken matplotlib-base
conda install -c conda-forge/label/matplotlib-base_rc matplotlib-base
conda install -c conda-forge/label/rc matplotlib-base
conda install -c conda-forge/label/cf201901 matplotlib-base

Recommended Installation

For most users, the standard conda-forge channel is sufficient ?

conda install -c conda-forge matplotlib-base

This installs the latest stable version without Qt dependencies.

Testing the Installation

Verify matplotlib-base works correctly with basic plotting ?

import matplotlib
matplotlib.use('Agg')  # Non-interactive backend
import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(0, 10, 100)
y = np.sin(x)

plt.figure(figsize=(8, 6))
plt.plot(x, y)
plt.title('Sine Wave')
plt.xlabel('X values')
plt.ylabel('Y values')
plt.savefig('sine_wave.png')
print("Plot saved as sine_wave.png")
Plot saved as sine_wave.png

When to Use Different Labels

Different conda-forge labels serve specific purposes:

  • conda-forge − Latest stable release (recommended)
  • testing − Pre-release versions for testing
  • rc − Release candidate versions
  • gcc7 − Compiled with GCC 7 (for compatibility)

Conclusion

Install matplotlib-base using conda install -c conda-forge matplotlib-base for a lightweight Matplotlib installation without Qt. This approach is perfect for server applications or when you only need basic plotting functionality.

---
Updated on: 2026-03-25T23:17:49+05:30

643 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements