pydata / bottleneck

Fast NumPy array functions written in C
BSD 2-Clause "Simplified" License
1.08k stars 104 forks source link

[BUG] installation fails on python 3.13 #459

Closed veenstrajelmer closed 1 month ago

veenstrajelmer commented 1 month ago

Describe the bug When pip-installing bottleneck in an environment with Python 3.13, installation fails.

To Reproduce pip install bottleneck in python 3.13 env.

Results in:

Collecting bottleneck
  Using cached bottleneck-1.4.0.tar.gz (103 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in c:\users\veenstra\appdata\local\miniforge3\envs\py313_env\lib\site-packages (from bottleneck) (2.1.2)
Building wheels for collected packages: bottleneck
  Building wheel for bottleneck (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for bottleneck (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [54 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build\lib.win-amd64-cpython-313\bottleneck
      copying bottleneck\_pytesttester.py -> build\lib.win-amd64-cpython-313\bottleneck
      copying bottleneck\_version.py -> build\lib.win-amd64-cpython-313\bottleneck
      copying bottleneck\__init__.py -> build\lib.win-amd64-cpython-313\bottleneck
      creating build\lib.win-amd64-cpython-313\bottleneck\benchmark
      copying bottleneck\benchmark\autotimeit.py -> build\lib.win-amd64-cpython-313\bottleneck\benchmark
      copying bottleneck\benchmark\bench.py -> build\lib.win-amd64-cpython-313\bottleneck\benchmark
      copying bottleneck\benchmark\bench_detailed.py -> build\lib.win-amd64-cpython-313\bottleneck\benchmark
      copying bottleneck\benchmark\__init__.py -> build\lib.win-amd64-cpython-313\bottleneck\benchmark
      creating build\lib.win-amd64-cpython-313\bottleneck\slow
      copying bottleneck\slow\move.py -> build\lib.win-amd64-cpython-313\bottleneck\slow
      copying bottleneck\slow\nonreduce.py -> build\lib.win-amd64-cpython-313\bottleneck\slow
      copying bottleneck\slow\nonreduce_axis.py -> build\lib.win-amd64-cpython-313\bottleneck\slow
      copying bottleneck\slow\reduce.py -> build\lib.win-amd64-cpython-313\bottleneck\slow
      copying bottleneck\slow\__init__.py -> build\lib.win-amd64-cpython-313\bottleneck\slow
      creating build\lib.win-amd64-cpython-313\bottleneck\src
      copying bottleneck\src\bn_config.py -> build\lib.win-amd64-cpython-313\bottleneck\src
      copying bottleneck\src\bn_template.py -> build\lib.win-amd64-cpython-313\bottleneck\src
      copying bottleneck\src\__init__.py -> build\lib.win-amd64-cpython-313\bottleneck\src
      creating build\lib.win-amd64-cpython-313\bottleneck\tests
      copying bottleneck\tests\common.py -> build\lib.win-amd64-cpython-313\bottleneck\tests
      copying bottleneck\tests\input_modification_test.py -> build\lib.win-amd64-cpython-313\bottleneck\tests
      copying bottleneck\tests\list_input_test.py -> build\lib.win-amd64-cpython-313\bottleneck\tests
      copying bottleneck\tests\memory_test.py -> build\lib.win-amd64-cpython-313\bottleneck\tests
      copying bottleneck\tests\move_test.py -> build\lib.win-amd64-cpython-313\bottleneck\tests
      copying bottleneck\tests\nonreduce_axis_test.py -> build\lib.win-amd64-cpython-313\bottleneck\tests
      copying bottleneck\tests\nonreduce_test.py -> build\lib.win-amd64-cpython-313\bottleneck\tests
      copying bottleneck\tests\reduce_test.py -> build\lib.win-amd64-cpython-313\bottleneck\tests
      copying bottleneck\tests\scalar_input_test.py -> build\lib.win-amd64-cpython-313\bottleneck\tests
      copying bottleneck\tests\test_template.py -> build\lib.win-amd64-cpython-313\bottleneck\tests
      copying bottleneck\tests\util.py -> build\lib.win-amd64-cpython-313\bottleneck\tests
      copying bottleneck\tests\__init__.py -> build\lib.win-amd64-cpython-313\bottleneck\tests
      creating build\lib.win-amd64-cpython-313\bottleneck\tests\data\template_test
      copying bottleneck\tests\data\template_test\test_template.c -> build\lib.win-amd64-cpython-313\bottleneck\tests\data\template_test
      copying bottleneck\tests\data\template_test\truth.c -> build\lib.win-amd64-cpython-313\bottleneck\tests\data\template_test
      UPDATING build\lib.win-amd64-cpython-313\bottleneck/_version.py
      set build\lib.win-amd64-cpython-313\bottleneck/_version.py to '1.4.0'
      running build_ext
      running config
      compiling '_configtest.c':

      int __attribute__((optimize("O3"))) have_attribute_optimize_opt_3(void*);

      int main(void)
      {
          return 0;
      }

      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: Failed building wheel for bottleneck
Failed to build bottleneck
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (bottleneck)

Expected behavior installation

veenstrajelmer commented 1 month ago

Thanks @rdbisme!