'How to resolve the error of legacy-install-failure?
building 'matplotlib.ft2font' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": <https://visualstudio.microsoft.com/visual-cpp-build-tools/>
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> matplotlib
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure
Solution 1:[1]
You need to download Microsoft C++ Build Tools and install it in your system then select Workloads and check the option of Desktop development using C++ . Once this is complete, you can run the installation command again.
OR
You can also choose to download this python library from Unofficial Windows Binaries for Python Extension Packages
- Download the file with name pip install matplotlib?3.5.1?cp38?cp38?win_amd64.whl Screenshot
- After downloading the file, open cmd in that folder and run the command:
- pip install matplotlib?3.5.1?cp38?cp38?win_amd64.whl
Solution 2:[2]
You need to download Microsoft C++ Build Tools and install it in your system then select Workloads and check the option of Desktop development using C++ .
pip install -r requirements.txt
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | satvik |
| Solution 2 | Kamol Boymatov |
