question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not build wheels for XXX which use PEP 517

See original GitHub issue
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • OS version and name: macOS 10.15
  • Poetry version: 1.0.0b4

Issue

#11 provides a workaround for custom build systems (e.g., Cython extensions) that works well with poetry. However, when you try to do pip install . on a project that has a custom build.py the build process fails with

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

This means, among other things, that one cannot use ReadTheDocs to document the code. This happens with my code but I have also tested it with pendulum.

Is there a workaround for this?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
albireoxcommented, Oct 29, 2019

Doing some more Googling on this I came up with the solution described here. One can create a setup.py file such as

from distutils.core import setup

import numpy

from Cython.Build import cythonize
from setuptools.extension import Extension


global setup_kwargs


extensions = [
    Extension('seiya.cube.cubify',
              ['seiya/cube/cubify.pyx'],
              include_dirs=[numpy.get_include()])
]


setup_kwargs = {}
setup_kwargs.update({'ext_modules': cythonize(extensions, annotate=True)})


setup(**setup_kwargs)

and remove the need of using build.py. As far as I can see this works fine (even allows editable installs!). When you do poetry install it creates an UNKNOWN.egg-info directory with PKG-INFO in which all the fields are UNKNOWN. That does not seem to affect poetry but I’m not sure what will happen when you build a distribution (I have run poetry build and the results look ok, with the correct metadata, but I haven’t tested it all the way by uploading it to PyPI and installing from a fresh environment).

IMHO poetry really needs to define a way to deal with extensions. There are many projects that depend on a custom build system and this kind of workarounds are getting old …

1reaction
syahdeinicommented, Jun 2, 2021

I use python 3.8.0, and this problem still occurs


    error: Command "clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/bzip2/include -I/usr/local/opt/readline/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/bzip2/include -I/usr/local/opt/readline/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -Ibuild/src.macosx-11.1-x86_64-3.8/numpy/core/src/common -Ibuild/src.macosx-11.1-x86_64-3.8/numpy/core/src/umath -Inumpy/core/include -Ibuild/src.macosx-11.1-x86_64-3.8/numpy/core/include/numpy -Ibuild/src.macosx-11.1-x86_64-3.8/numpy/distutils/include -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -Inumpy/core/src/_simd -I/Users/XXX/Library/Caches/pypoetry/virtualenvs/aep-T5QCnjDx-py3.8/include -I/Users/XXX/.pyenv/versions/3.8.0/include/python3.8 -Ibuild/src.macosx-11.1-x86_64-3.8/numpy/core/src/common -Ibuild/src.macosx-11.1-x86_64-3.8/numpy/core/src/npymath -c build/src.macosx-11.1-x86_64-3.8/numpy/core/src/umath/loops_unary_fp.dispatch.c -o build/temp.macosx-11.1-x86_64-3.8/build/src.macosx-11.1-x86_64-3.8/numpy/core/src/umath/loops_unary_fp.dispatch.o -MMD -MF build/temp.macosx-11.1-x86_64-3.8/build/src.macosx-11.1-x86_64-3.8/numpy/core/src/umath/loops_unary_fp.dispatch.o.d -msse -msse2 -msse3" failed with exit status 1
    ----------------------------------------
    ERROR: Failed building wheel for numpy
  Failed to build numpy
  ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly
  WARNING: You are using pip version 21.0.1; however, version 21.1.2 is available.
  You should consider upgrading via the '/Users/XXX/Library/Caches/pypoetry/virtualenvs/aep-T5QCnjDx-py3.8/bin/python -m pip install --upgrade pip' command.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not build wheels for numpy which use PEP 517 and ...
I got this below error message. Failed to build numpy ERROR: Could not build wheels for numpy which use PEP 517 and cannot...
Read more >
Could not build wheels for PyGObject which use PEP 517 and ...
Could not build wheels for PyGObject which use PEP 517 and cannot be installed directly. #358 (closed) (This solution doesn't solve problem either)....
Read more >
pyproject.toml with no build-system.requires - Distutils-SIG
When the build-system.requires key is missing, pip falls back to assuming it should be ["setuptools", "wheel"]. The in-development version of pip currently ...
Read more >
pip install - pip documentation v21.1.dev0
This section is only about installation order of runtime dependencies, and does not apply to build dependencies (those are specified using PEP 518)....
Read more >
Could not build wheels for hdbscan which use PEP 517 and ...
Problem尝试用pip 在命令行安装hdbscan 时,发生如下报错pip install hdbscan...Building wheels for collected packages: hdbscan Building wheel ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found