Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
lcflorindo opened this issue Nov 29, 2019 · 56 comments

Comments

@lcflorindo
Copy link

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) [email protected]:~/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
@lcflorindo
Copy link
Author

QUICK UPDATE I took some time to research the internet about: PEP517 have some problems with virtualenvs but i already tried --no-use-pep517 with no success and still retrying an error.

@qwhelan
Copy link
Collaborator

qwhelan commented Nov 29, 2019

Could you provide the pip version?

Thanks for reporting!

@qwhelan
Copy link
Collaborator

qwhelan commented Nov 30, 2019

On further investigation, I found this pypa/pip#6256 which suggests the issue is that wheels simply aren't supported with PEP 517 builds. My best guess would be to pip install --upgrade pip setuptools wheel and that should resolve the issue.

@lcflorindo
Copy link
Author

lcflorindo commented Dec 2, 2019

Could you provide the pip version?

Thanks for reporting!

pip 19.2.3 from /home/filholf/anaconda3/lib/python3.7/site-packages/pip (python 3.7)

I'm assuming that my OS is not helping as well, I'm using Suse 12 SP4, my other server is an Ubuntu 16.04lts and everything worked fine...

@lcflorindo
Copy link
Author

lcflorindo commented Dec 2, 2019

On further investigation, I found this pypa/pip#6256 which suggests the issue is that wheels simply aren't supported with PEP 517 builds. My best guess would be to pip install --upgrade pip setuptools wheel and that should resolve the issue.

I tried the upgrade, but stills returning the wheel problem. I'm totally able to install it at base.

But as a quick update, I solved installing Anaconda instead of miniconda, but not sure about the relation of both or even what was the problem with miniconda. Could it be a repair when I uninstalled/installed.

@qwhelan
Copy link
Collaborator

qwhelan commented Dec 3, 2019

Hmm, there really shouldn't be a difference between equivalent versions of Miniconda/Anaconda.

Good to hear it's resolved and apologies for not having a clear answer here. Please feel free to re-open if it re-surfaces.

@AnakTeka
Copy link

AnakTeka commented Jan 2, 2020

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

@harshikanu
Copy link

Another way to resolve this is to download Windows SDK 10 (latest version). If this alone doesn't work then download Visual Studio 2019 (again whichever is the latest version). This updates the wheel process.

@bchen32
Copy link

bchen32 commented Feb 21, 2020

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

@qwhelan
Copy link
Collaborator

qwhelan commented Feb 21, 2020

@StormFalcon32 Do you happen to know the version of the Windows SDK you were on pre-upgrade? And pip and python as well?

@bchen32
Copy link

bchen32 commented Feb 21, 2020

Oh man I don't remember what version of Windows sdk but I was on Python 3.7.6 and I think 20.0.2 on pip

@qwhelan
Copy link
Collaborator

qwhelan commented Feb 21, 2020

Thanks for checking - was mostly wondering if this was connected to the Python 3.8 issue some Arch users had reported (and should be fixed by 1.3.2 that I released a few minutes ago)

@bayesfactor
Copy link

I installed Build Tools for Visual Studio 2019, updated wheels, and I still have the error when installing Bottleneck-1.3.2.:
Failed to build bottleneck
ERROR: Could not build wheels for bottleneck which use PEP 517 and cannot be installed directly

python 3.5.5
wheel 0.34.2
pip 20.0.2

@harshikanu
Copy link

@bayesfactor I think you need to have the latest version of python installed.

@rhandberg
Copy link

I am getting the same error with Bottleneck 1.3.2 on a Linux machine with Python 3.6.3, and the newest versions of pip and setuptools... It works fine with 1.3.1... Any ideas?

@corysm1th
Copy link

corysm1th commented Mar 17, 2020

@rhandberg I had the same issue on CentOS. My output contained the following error:
bottleneck/src/bottleneck.h:6:20: fatal error: Python.h: No such file or directory #include <Python.h> ^
Which I solved by installing the python3 source
yum install -y python3-devel

@cartene
Copy link

cartene commented Mar 20, 2020

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

same error using ubuntu:18.04 with minconda and python==3.7; fixed by installing build-essential.

@muneale
Copy link

muneale commented Apr 3, 2020

I got the same issue when I execute:
$ pipenv install bottleneck

I solved the problem with:
$ python3.7 -m pipenv install bottleneck

OS: Ubuntu 18.04 LTS
Python: 3.7
Pip: 20.0.2
Bottleneck: 1.3.2

@rasihilp
Copy link

rasihilp commented May 8, 2020

If still having issue, can try below steps. It worked for windows
https://medium.com/@pierre_guillou/how-to-install-fastai-v1-on-windows-10-ca1bc370dce4

@talha1503
Copy link

I'm having the same issue.
OS: Windows 10
Python : 3.8
pip:19.2.3
Bottleneck:1.3.2

I have also installed Build Tools for Visual Studio 2019.

@neelnova
Copy link

neelnova commented May 26, 2020

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

I am using python version - 3.6.0
still, I am getting error like

Failed building wheel for bottleneck
Running setup.py clean for bottleneck
Failed to build bottleneck
Could not build wheels for bottleneck which use PEP 517 and cannot be installed directly

@SergeiMerson-StartUpAI
Copy link

Hi,
I solved this issue by downloading appropriate version of line_profiler from:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#line_profiler
and then installing it using "pip install your_package_version_.whl"
Hope that it would help

@marcmaxson
Copy link

I couldn't get pipenv update to work with hdbscan but pip install -r requirements.txt worked for me on MacOS and in the docker container I was putting this into for AWS.

@kevinsingapore
Copy link

i got the same error;
os: centos7-aarch64
python verison: 3.6.8
pip version: 20.1.1
and the error info:

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

and how to solve the error?

@nanounanue
Copy link

nanounanue commented Jun 2, 2020

Same error in alpine:latest image with python 3.8 and pip-19.2.3

@ee07dazn
Copy link

ee07dazn commented Jun 3, 2020

Downgrading the pip version sorted the issue for me : pip install pip==18.1

@fengmang-k
Copy link

for windows I installed c++ complier solved this problem

@ddowbnac
Copy link

ddowbnac commented Nov 9, 2020

For alpine linux i fixed with:
apk add gcc libc-dev

check it with apt or etc in your linux distribution

@ag-hcoder
Copy link

Use sudo

@nastynaz
Copy link

nastynaz commented Dec 2, 2020

For alpine I needed apk add gcc libc-dev g++

@Neele22
Copy link

Neele22 commented Jan 12, 2021

I have the same issue when running
pipenv install django-oscar

Error message: Could not build wheels for oscar which use PEP 517 and cannot be installed directly

I am using Windows 10 Home 1909, Python 3.8, pipenv 2018.11.26, and VScode 1.52.1

@reyesGeorge
Copy link

I was having the same problem for Mac: ERROR: Failed building wheel for pycairo
While installing cairo into a virtual env. I solved by running:

first: brew install cairo pkg-config
then: pip install cairo

@one-two-one-two
Copy link

one-two-one-two commented Mar 15, 2021

#281 (comment)

Same here, in a dockerfile from python:3.7-slim-buster
adding
RUN apt-get update && apt-get install -y build-essential
solves the issue

Edit: On a linux server (as opposed to the docker image above) i also had to install python3.6-dev

@jl710107
Copy link

Hoy vienes 26 de marzo del 2021
Reporto este error al instalar pynacl
En mi móvil A01 CORE DE SAMSUNG EN LA APP TERMUX
Si es posible darme alguna solución lo agradesere.
ERROR: Failed building wheel for pynacl
Failed to build pynacl
ERROR: Could not build wheels for pynacl which use PEP 517 and cannot be installed directly.
Gracias

1 similar comment
@jokerarthur28
Copy link

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
Copy link

mortada commented May 31, 2021

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: Deprecate call to setup.py install when building a wheel failed for source distributions without pyproject.toml pypa/pip#8368)

@pavankumarg1729
Copy link

for windows I installed c++ complier solved this problem

this worked for me too

@DataPhill
Copy link

DataPhill commented Aug 9, 2021

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 👍

pip install fancyimpute

#281

@vlnahp
Copy link

vlnahp commented Sep 8, 2021

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests