[Python] Can't install Python fasttext on Windows 11 – string_view not found despite Visual...

Discussão em 'Python' iniciado por Stack, Abril 16, 2025.

  1. Stack

    Stack Membro Participativo

    I'm hitting a wall trying to install the Python package fasttext on Windows 11, and I'm getting C++ build errors despite setting everything up correctly (or so I thought). Here's the full context of what I’ve done.

    Environment:

    • OS: Windows 11 64-bit
    • Python: 3.11 (installed via python.org)
    • Visual Studio: 2022 Community Edition – v17.13.6
    • pip: 22.3.1

    I'm installing using the "x64 Native Tools Command Prompt for VS 2022", so that cl.exe is properly available

    Visual Studio has all required components installed, including:

    • MSVC v143 – VS 2022 C++ x64/x86 Build Tools (latest)
    • C++ Clang compiler for Windows
    • Spectre-mitigated libs for MSVC 2017/2019/2022
    • SDKs and build tools
    • Python development + Desktop development with C++

    [​IMG]

    Here's the relevant part of the error:

    error C2039: 'string_view' is not a member of 'std'
    warning STL4038: The contents of <string_view> are available only with C++17 or later


    Despite explicitly setting /std:c++17, it still fails and behaves like it’s compiling in an older standard.

    Bonus: how to list all installed Visual Studio components?

    If there's a CLI way to list all workloads/tools/components installed by Visual Studio, I’d love to include that here to help debugging.

    C:\Program Files (x86)\Microsoft Visual Studio\Installer>vswhere.exe -all -products * -format json
    [
    {
    "instanceId": "cb9d49b8",
    "installDate": "2025-04-16T12:11:09Z",
    "installationName": "VisualStudio/17.13.6+35931.197",
    "installationPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community",
    "installationVersion": "17.13.35931.197",
    "productId": "Microsoft.VisualStudio.Product.Community",
    "productPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\devenv.exe",
    "state": 4294967295,
    "isComplete": true,
    "isLaunchable": true,
    "isPrerelease": false,
    "isRebootRequired": false,
    "displayName": "Visual Studio Community 2022",
    "description": "IDE puissant, gratuit pour les étudiants, les contributeurs open source et les particuliers",
    "channelId": "VisualStudio.17.Release",
    "channelUri": "https://aka.ms/vs/17/release/channel",
    "enginePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\resources\\app\\ServiceHub\\Services\\Microsoft.VisualStudio.Setup.Service",
    "installedChannelId": "VisualStudio.17.Release",
    "installedChannelUri": "https://aka.ms/vs/17/release/channel",
    "releaseNotes": "https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-v17.13#17.13.6",
    "resolvedInstallationPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community",
    "thirdPartyNotices": "https://go.microsoft.com/fwlink/?LinkId=661288",
    "updateDate": "2025-04-16T12:11:09.5432099Z",
    "catalog": {
    "buildBranch": "d17.13",
    "buildVersion": "17.13.35931.197",
    "id": "VisualStudio/17.13.6+35931.197",
    "localBuild": "build-lab",
    "manifestName": "VisualStudio",
    "manifestType": "installer",
    "productDisplayVersion": "17.13.6",
    "productLine": "Dev17",
    "productLineVersion": "2022",
    "productMilestone": "RTW",
    "productMilestoneIsPreRelease": "False",
    "productName": "Visual Studio",
    "productPatchVersion": "6",
    "productPreReleaseMilestoneSuffix": "1.0",
    "productSemanticVersion": "17.13.6+35931.197",
    "requiredEngineVersion": "3.13.2069.59209"
    },
    "properties": {
    "campaignId": "",
    "canceled": "0",
    "channelManifestId": "VisualStudio.17.Release/17.13.6+35931.197",
    "includeRecommended": "1",
    "nickname": "",
    "setupEngineFilePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\setup.exe"
    }
    }
    ]

    Continue reading...

Compartilhe esta Página