Home >Backend Development >Python Tutorial >Why Does Installing Python Packages Fail with 'error: Microsoft Visual C 14.0 or greater is required'?

Why Does Installing Python Packages Fail with 'error: Microsoft Visual C 14.0 or greater is required'?

Mary-Kate Olsen
Mary-Kate OlsenOriginal
2024-12-23 16:45:15879browse

Why Does Installing Python Packages Fail with

Troubleshooting: "error: Microsoft Visual C 14.0 or greater is required" During Python Package Installation

When attempting to install Python packages, you may encounter an error indicating that Microsoft Visual C 14.0 or higher is required. Despite updating to version 14.27, the error persists. Let's delve into the solution to resolve this issue.

Solution:

  1. Visit the Microsoft C Build Tools download page: https://visualstudio.microsoft.com/visual-cpp-build-tools/
  2. Install the Microsoft C Build Tools by following the prompts.
  3. If the error persists, click "Modify" in the installer to update or configure specific components.
  4. Ensure that the following are enabled:

    • Windows 10 SDK
    • C x64/x86 build tools
  5. Alternatively, you can automate the installation with the command:
vs_buildtools.exe --norestart --passive --downloadThenInstall --includeRecommended --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Workload.MSBuildTools

Additional Note (December 28, 2020):

For an updated approach, consider the following steps:

  1. Select "Workloads → Desktop development with C "
  2. Under "Individual Components," enable only:

    • Windows 10 SDK
    • C x64/x86 build tools

Refer to https://www.scivision.dev/python-windows-visual-c-14-required for further details.

The above is the detailed content of Why Does Installing Python Packages Fail with 'error: Microsoft Visual C 14.0 or greater is required'?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn