Skip to content

NumPy 2.0.2 Installation Fails on Windows Without C Compiler #2352

Open
@farzad528

Description

@farzad528

🐛 Describe the bug

Description
When running poetry install --with test on Windows, NumPy 2.0.2 installation fails due to missing C compiler. The current dependency requirements force NumPy to build from source instead of using pre-compiled wheels.

Environment
OS: Windows
Python version: 3.x (exact version to be specified)
Poetry version: 2.1.1
Project: mem0ai

Error Message

Installing dependencies from lock file
Package operations: 25 installs, 0 updates, 0 removals
  - Installing numpy (2.0.2): Failed
PEP517 build of a dependency failed
Backend subprocess exited when trying to invoke build_wheel

ERROR: Unknown compiler(s): [['icl'], ['cl'], ['cc'], ['gcc'], ['clang'], ['clang-cl'], ['pgcc']]
The following exception(s) were encountered:
Running `icl ""` gave "[WinError 2] The system cannot find the file specified"
Running `cl /?` gave "[WinError 2] The system cannot find the file specified"
Running `cc --version` gave "[WinError 2] The system cannot find the file specified"
Running `gcc --version` gave "[WinError 2] The system cannot find the file specified"
Running `clang --version` gave "[WinError 2] The system cannot find the file specified"
Running `clang-cl /?` gave "[WinError 2] The system cannot find the file specified"
Running `pgcc --version` gave "[WinError 2] The system cannot find the file specified"

Steps to Reproduce

  1. Clone the repository
  2. Run poetry install --with test

Expected Behavior
Poetry should either:

  1. Use pre-compiled NumPy wheels instead of building from source
  2. Clearly document the need for Visual C++ build tools in the project's contributing guide

Suggested Solutions

  1. Pin NumPy to a version that has pre-compiled wheels for Windows
  2. Update contributing.md to mention the need for Visual C++ build tools
  3. Modify pyproject.toml to specify NumPy requirement in a way that prefers wheels over source builds
  4. Add a note about installing Visual Studio Build Tools in the setup instructions

Workarounds
For contributors who encounter this issue:

  1. Install Visual Studio Build Tools with "Desktop development with C++" workload
  2. Or install NumPy separately using pip install --only-binary=numpy numpy==2.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions