bottleneck icon indicating copy to clipboard operation
bottleneck copied to clipboard

ERROR: Could not build wheels for bottleneck which use PEP 517 and cannot be installed directly

Open 1ycx opened this issue 4 years ago • 4 comments

I was installing fastai library and the build was failing every time during Bottleneck installation. So I tried installing the Bottleneck library separately. I also have the Visual Studio Build Tools v14 installed. Python v3.6.8 Install via pip Latest setuptools and wheel

This issue is already exists here https://github.com/pydata/bottleneck/issues/281 but its closed.

I also tried installing the v1.3.1 of Bottleneck but that fails too. Here are my logs:

(env) PS C:\Users\Home\code\fastaiv1> pip install Bottleneck
Collecting Bottleneck
  Using cached Bottleneck-1.3.2.tar.gz (88 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied: numpy in c:\users\home\code\fastaiv1\env\lib\site-packages (from Bottleneck) (1.18.4)
Building wheels for collected packages: Bottleneck
  Building wheel for Bottleneck (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\home\code\fastaiv1\env\scripts\python.exe' 'c:\users\home\code\fastaiv1\env\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\Home\AppData\Local\Temp\tmpyzm5m1p_'
       cwd: C:\Users\Home\AppData\Local\Temp\pip-install-19wf0lri\Bottleneck
  Complete output (91 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.6
  creating build\lib.win-amd64-3.6\bottleneck
  copying bottleneck\_pytesttester.py -> build\lib.win-amd64-3.6\bottleneck
  copying bottleneck\_version.py -> build\lib.win-amd64-3.6\bottleneck
  copying bottleneck\__init__.py -> build\lib.win-amd64-3.6\bottleneck
  creating build\lib.win-amd64-3.6\bottleneck\benchmark
  copying bottleneck\benchmark\autotimeit.py -> build\lib.win-amd64-3.6\bottleneck\benchmark
  copying bottleneck\benchmark\bench.py -> build\lib.win-amd64-3.6\bottleneck\benchmark
  copying bottleneck\benchmark\bench_detailed.py -> build\lib.win-amd64-3.6\bottleneck\benchmark
  copying bottleneck\benchmark\__init__.py -> build\lib.win-amd64-3.6\bottleneck\benchmark
  creating build\lib.win-amd64-3.6\bottleneck\slow
  copying bottleneck\slow\move.py -> build\lib.win-amd64-3.6\bottleneck\slow
  copying bottleneck\slow\nonreduce.py -> build\lib.win-amd64-3.6\bottleneck\slow
  copying bottleneck\slow\nonreduce_axis.py -> build\lib.win-amd64-3.6\bottleneck\slow
  copying bottleneck\slow\reduce.py -> build\lib.win-amd64-3.6\bottleneck\slow
  copying bottleneck\slow\__init__.py -> build\lib.win-amd64-3.6\bottleneck\slow
  creating build\lib.win-amd64-3.6\bottleneck\src
  copying bottleneck\src\bn_config.py -> build\lib.win-amd64-3.6\bottleneck\src
  copying bottleneck\src\bn_template.py -> build\lib.win-amd64-3.6\bottleneck\src
  copying bottleneck\src\__init__.py -> build\lib.win-amd64-3.6\bottleneck\src
  creating build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\input_modification_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\list_input_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\memory_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\move_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\nonreduce_axis_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\nonreduce_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\reduce_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\scalar_input_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\util.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\__init__.py -> build\lib.win-amd64-3.6\bottleneck\tests
  UPDATING build\lib.win-amd64-3.6\bottleneck/_version.py
  set build\lib.win-amd64-3.6\bottleneck/_version.py to '1.3.2'
  running build_ext
  running config
  compiling '_configtest.c':



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

  int main(void)
  {
      return 0;
  }

  C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\include" /Tc_configtest.c /Fo_configtest.obj
  _configtest.c
  _configtest.c(4): error C2143: syntax error: missing ')' before '('
  _configtest.c(4): error C2091: function returns function
  _configtest.c(4): error C2143: syntax error: missing ')' before 'string'
  _configtest.c(4): error C2143: syntax error: missing '{' before 'string'
  _configtest.c(4): error C2059: syntax error: 'string'
  _configtest.c(4): error C2059: syntax error: ')'
  failure.
  removing: _configtest.c _configtest.obj
  compiling '_configtest.c':

  #ifndef __cplusplus
  static inline int static_func (void)
  {
      return 0;
  }
  inline int nostatic_func (void)
  {
      return 0;
  }
  #endif
  int main(void) {
      int r1 = static_func();
      int r2 = nostatic_func();
      return r1 + r2;
  }

  C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\include" /Tc_configtest.c /Fo_configtest.obj
  _configtest.c
  success!
  removing: _configtest.c _configtest.obj
  building 'bottleneck.reduce' extension
  creating build\temp.win-amd64-3.6
  creating build\temp.win-amd64-3.6\Release
  creating build\temp.win-amd64-3.6\Release\bottleneck
  creating build\temp.win-amd64-3.6\Release\bottleneck\src
  C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\Home\AppData\Local\Temp\pip-build-env-ex_j6m8_\overlay\Lib\site-packages\numpy\core\include -Ic:\users\home\code\fastaiv1\env\include -IC:\Users\Home\AppData\Local\Programs\Python\Python36\include -IC:\Users\Home\AppData\Local\Programs\Python\Python36\include -Ibottleneck/src "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\include" /Tcbottleneck/src/reduce.c /Fobuild\temp.win-amd64-3.6\Release\bottleneck/src/reduce.obj -O2
  reduce.c
  C:\Users\Home\AppData\Local\Programs\Python\Python36\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.25.28610\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
  ----------------------------------------
  ERROR: Failed building wheel for Bottleneck
Failed to build Bottleneck
ERROR: Could not build wheels for Bottleneck which use PEP 517 and cannot be installed directly

1ycx avatar May 05 '20 23:05 1ycx

Well, I installed the latest Win 10 SDK and it installs properly. But not everyone will want to install 1GB of Visual Studio Build Tools.

1ycx avatar May 05 '20 23:05 1ycx

I've merged some improved logging but have not yet included it in a release.

I'm happy to consider PRs that would help us move towards releasing pre-compiled binaries that support runtime enabling of certain optimizations, but that's a lot more work than I have bandwidth for at the moment.

I think it's reasonable to expect Windows users to have the right SDK installed if they're not using Anaconda, as you're going to be seeing pretty terrible performance with the standard wheels otherwise (no BLAS/mkl/etc).

qwhelan avatar May 07 '20 23:05 qwhelan

any update??

PriyatamNayak avatar Jan 25 '21 02:01 PriyatamNayak

@qwhelan Any update??

PriyatamNayak avatar Jan 25 '21 03:01 PriyatamNayak