Home > Net >  Python (Matplotlib): Having issues installing matplotlib
Python (Matplotlib): Having issues installing matplotlib

Time:11-01


    python3.10 -m pip install --user matplotlib

I keep getting the following error when I run the above to install matplotlib, I was initially getting a c error and I installed the packages from Visual studio and no

Time Elapsed 00:00:00.36 error: command 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe' failed with exit code 1 ---------------------------------------- ERROR: Command errored out with exit status 1: 'C:\Users\HP\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\HP\AppData\Local\Temp\pip-install-zq_i4lrq\matplotlib_ce44358747c74e83a93eefbdd122f13e\setup.py'"'"'; file='"'"'C:\Users\HP\AppData\Local\Temp\pip-install-zq_i4lrq\matplotlib_ce44358747c74e83a93eefbdd122f13e\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\HP\AppData\Local\Temp\pip-record-yvrkad5m\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\HP\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Include\matplotlib' Check the logs for full command output.

CodePudding user response:

Matplotlib doesn't support Python 3.10 at the moment, so you have the following options.

  1. Downgrade to Python 3.10
  2. Install the pre-release version of Matplotlib which does support Python 3.10. This can be done with the command pip install matplotlib==3.5.0rc1 (this is what I would recommend doing)
  • Related