[Python] PyTorch fails on Windows Server 2019: “Error loading c10.dll” (works fine on Windows...

Discussão em 'Python' iniciado por Stack, Novembro 21, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to deploy a Python project on Windows Server 2019, but PyTorch fails to import with a DLL loading error.
    On my local machine (Windows 10, same Python version), everything works perfectly.

    Environment

    Working machine


    • Windows 10 x64


    • Python 3.11 (64-bit)


    • PyTorch: torch==2.9.0 (or +cpu)


    • import torch works without any problem.
    Failing machine


    • Windows Server 2019


    • Python 3.11 (64-bit)


    • No internet access


    • Same virtual environment recreated using pip download + offline installation


    • Microsoft Visual C++ Redistributable installed (2015 and also 2015–2022 x64)
    Initial error (before installing newer VC++ runtimes)


    When I simply run:

    import torch


    I get:

    OSError: [WinError 1114] A dynamic link library (DLL) initialization routine failed.
    Error loading "...\torch\lib\c10.dll" or one of its dependencies.


    The file c10.dll exists in the correct folder (torch\lib), but Windows Server refuses to load it.

    The exact same environment (same Python, same package versions, same torch wheel) works fine on Windows 10.

    What I want to understand


    • Why does c10.dll fail to load specifically on Windows Server 2019?


    • Is this caused by:

      • Missing MSVC runtime?


      • PyTorch not supporting Windows Server?


      • CPU instruction set differences?


      • Something else that differs between Win10 and Server 2019?

    I'm only asking about the initial c10.dll error.
    Any insight on why PyTorch loads on Windows 10 but not on Windows Server 2019 would be greatly appreciated.

    Continue reading...

Compartilhe esta Página