Matplotlib Installation Error in Windows 10 – ibilgen – Medium

I encountered an error while trying to install matplotlib using pip in Windows 10. I simply run the command below in a venv virtual environment to install matplotlib library.

$ python -m pip install -U matplotlib

However, it encountered an error while generating package metadata (pyproject.toml).

Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [22 lines of output]

As a neat solution to this easy yet to be time sink problem, I just added the --prefer-binary and the problem has solved.

$ python -m pip install -U matplotlib --prefer-binary

For more information, you can check out Installation — Matplotlib 3.9.1 documentation.

Leave a Reply