pydata / bottleneck

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

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

Closed lcflorindo closed 4 years ago

lcflorindo commented 4 years ago

Hi, I'm installing Bottleneck by fastai lib in a Suse 12 sp4 server, but had the error when building wheels for it. It says that uses PEP517 and cannot be installed directly. Funny thing is that I had it installed on my (base) but when I move to my app env it just jams on the error. There is a way to solve it? Thanks in advance!

(pycamlar) (base) filholf@127.0.0.1:~/pycamlar> pip install --no-cache-dir Bottleneck
Collecting Bottleneck
  Downloading https://files.pythonhosted.org/packages/62/d0/55bbb49f4fade3497de2399af70ec0a06e432c786b8623c878b11e90d456/Bottleneck-1.3.1.tar.gz (88kB)
     |████████████████████████████████| 92kB 1.1MB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied: numpy in ./pycamlar/lib/python3.7/site-packages (from Bottleneck) (1.17.4)
Building wheels for collected packages: Bottleneck
  Building wheel for Bottleneck (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/filholf/pycamlar/pycamlar/bin/python /home/filholf/pycamlar/pycamlar/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpzdoiga7s
       cwd: /tmp/pip-install-gx8dza5k/Bottleneck
  Complete output (122 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.7
  creating build/lib.linux-x86_64-3.7/bottleneck
  copying bottleneck/__init__.py -> build/lib.linux-x86_64-3.7/bottleneck
  copying bottleneck/_pytesttester.py -> build/lib.linux-x86_64-3.7/bottleneck
  copying bottleneck/_version.py -> build/lib.linux-x86_64-3.7/bottleneck
  creating build/lib.linux-x86_64-3.7/bottleneck/benchmark
  copying bottleneck/benchmark/__init__.py -> build/lib.linux-x86_64-3.7/bottleneck/benchmark
  copying bottleneck/benchmark/autotimeit.py -> build/lib.linux-x86_64-3.7/bottleneck/benchmark
  copying bottleneck/benchmark/bench.py -> build/lib.linux-x86_64-3.7/bottleneck/benchmark
  copying bottleneck/benchmark/bench_detailed.py -> build/lib.linux-x86_64-3.7/bottleneck/benchmark
  creating build/lib.linux-x86_64-3.7/bottleneck/slow
  copying bottleneck/slow/__init__.py -> build/lib.linux-x86_64-3.7/bottleneck/slow
  copying bottleneck/slow/move.py -> build/lib.linux-x86_64-3.7/bottleneck/slow
  copying bottleneck/slow/nonreduce.py -> build/lib.linux-x86_64-3.7/bottleneck/slow
  copying bottleneck/slow/nonreduce_axis.py -> build/lib.linux-x86_64-3.7/bottleneck/slow
  copying bottleneck/slow/reduce.py -> build/lib.linux-x86_64-3.7/bottleneck/slow
  creating build/lib.linux-x86_64-3.7/bottleneck/src
  copying bottleneck/src/__init__.py -> build/lib.linux-x86_64-3.7/bottleneck/src
  copying bottleneck/src/bn_config.py -> build/lib.linux-x86_64-3.7/bottleneck/src
  copying bottleneck/src/bn_template.py -> build/lib.linux-x86_64-3.7/bottleneck/src
  creating build/lib.linux-x86_64-3.7/bottleneck/tests
  copying bottleneck/tests/__init__.py -> build/lib.linux-x86_64-3.7/bottleneck/tests
  copying bottleneck/tests/input_modification_test.py -> build/lib.linux-x86_64-3.7/bottleneck/tests
  copying bottleneck/tests/list_input_test.py -> build/lib.linux-x86_64-3.7/bottleneck/tests
  copying bottleneck/tests/memory_test.py -> build/lib.linux-x86_64-3.7/bottleneck/tests
  copying bottleneck/tests/move_test.py -> build/lib.linux-x86_64-3.7/bottleneck/tests
  copying bottleneck/tests/nonreduce_axis_test.py -> build/lib.linux-x86_64-3.7/bottleneck/tests
  copying bottleneck/tests/nonreduce_test.py -> build/lib.linux-x86_64-3.7/bottleneck/tests
  copying bottleneck/tests/reduce_test.py -> build/lib.linux-x86_64-3.7/bottleneck/tests
  copying bottleneck/tests/scalar_input_test.py -> build/lib.linux-x86_64-3.7/bottleneck/tests
  copying bottleneck/tests/util.py -> build/lib.linux-x86_64-3.7/bottleneck/tests
  UPDATING build/lib.linux-x86_64-3.7/bottleneck/_version.py
  set build/lib.linux-x86_64-3.7/bottleneck/_version.py to '1.3.1'
  running build_ext
  running config
  compiling '_configtest.c':

  #pragma GCC diagnostic error "-Wattributes"

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

  int main(void)
  {
      return 0;
  }

  gcc -pthread -B /home/filholf/miniconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -c _configtest.c -o _configtest.o
  failure.
  removing: _configtest.c _configtest.o
  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;
  }

  gcc -pthread -B /home/filholf/miniconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -c _configtest.c -o _configtest.o
  failure.
  removing: _configtest.c _configtest.o
  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;
  }

  gcc -pthread -B /home/filholf/miniconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -c _configtest.c -o _configtest.o
  failure.
  removing: _configtest.c _configtest.o
  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;
  }

  gcc -pthread -B /home/filholf/miniconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -c _configtest.c -o _configtest.o
  failure.
  removing: _configtest.c _configtest.o
  building 'bottleneck.reduce' extension
  creating build/temp.linux-x86_64-3.7
  creating build/temp.linux-x86_64-3.7/bottleneck
  creating build/temp.linux-x86_64-3.7/bottleneck/src
  gcc -pthread -B /home/filholf/miniconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/tmp/pip-build-env-i9jvt975/overlay/lib/python3.7/site-packages/numpy/core/include -I/home/filholf/miniconda3/include/python3.7m -Ibottleneck/src -c bottleneck/src/reduce.c -o build/temp.linux-x86_64-3.7/bottleneck/src/reduce.o -O2
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for Bottleneck
  Running setup.py clean for Bottleneck
Failed to build Bottleneck
ERROR: Could not build wheels for Bottleneck which use PEP 517 and cannot be installed directly
jokerarthur28 commented 3 years ago

I'm receiving a same error and using python:3.6-slim docker image, I fixed it by installing gcc inside the container.

how to install gcc inside the container?

mortada commented 3 years ago

I ran into this same error and resolved it by doing either one of the following two ways:

  1. run the install command with an extra argument: pip install --no-use-pep517
  2. downgrade pip from 21.x to 20.3 , then the simple pip install works for me again (see the context here: https://github.com/pypa/pip/issues/8368)
pavankumarg1729 commented 3 years ago

for windows I installed c++ complier solved this problem

this worked for me too

DataPhill commented 3 years ago

Hi All, having troubles installing fancyImpute ???

Open the atched file : [requirements.txt]

(https://github.com/pydata/bottleneck/files/6956991/requirements.txt)

Install each dependency in the txt file separately:

Since, i have noticed the cvxpy gives the error when installing:

ERROR: Failed building wheel for scs Failed to build scs ERROR: Could not build wheels for scs which use PEP 517 and cannot be installed directly

Then: use the following command to install it:

conda install -c conda-forge cvxpy

finally then :+1:

pip install fancyimpute

281

vlnahp commented 3 years ago

I had the same problem with coincurve, and the solution was unbelievably easy!

I simply installed the lowest version that meets my needs. And it worked!

The latest version was 15.0.1 and I installed version 4.4.0 without any error.

SSI7210153 commented 3 years ago

harshikanu's suggestion worked for me. I'd like to expand on it a little bit

  1. Go to visual studio downloads at https://visualstudio.microsoft.com/downloads/
  2. Scroll down to 'All Downloads'
  3. Click the dropdown for 'Tools for Visual Studio 2019'
  4. Download 'Build Tools for Visual Studio 2019'

and that should successfully update wheel and allow you to install bottleneck

This solution worked. Thank you. I took advantage of and installed some packages for my visual studio code and also some tools to compile Cmakes.