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.

PyPy 7.3.7 & MacOS 11.x: Numpy fails to build, but only as a build dependency when `--use-pep517` is active.

See original GitHub issue

Description

Under PyPy 7.3.7, Numpy can be built and installed from source with pip install numpy, but it fails to build when being used as a PEP 517 build dependency, with an assertion error about an unsupported tag ('pp37', 'pypy37_pp73', 'macosx_10_7_x86_64').

However, it does appear to work with the --no-use-pep517 flag (at least, it proceeds beyond Numpy and fails anyway because Cython is not available).

Expected behavior

I expected Numpy to work as a PEP 517 build dependency, because it works when I install it as a regular dependency

pip version

pip 21.3.1

Python version

PyPy 7.3.7 (3.7)

OS

MacOS 11.6.1

How to Reproduce

/usr/local/bin/pypy3 --version
# Python 3.7.12 (44db26267d0a38e51a7e8490983ed7e7bcb84b74, Oct 28 2021, 05:11:03)
# [PyPy 7.3.7 with GCC Apple LLVM 13.0.0 (clang-1300.0.29.3)]

/usr/local/bin/pypy3 -m venv ./my-project
./my-project/bin/python -m pip install -U pip setuptools wheel

This works fine:

./my-project/bin/python -m pip install numpy

This does not:

./my-project/bin/python -m pip install -U scipy

But this works fine (until it hits the unrelated Cython error):

./my-project/bin/python -m pip install --no-use-pep517 -U scipy

Output

< ... huge build log and traceback ... >

    AssertionError: would build wheel with unsupported tag ('pp37', 'pypy37_pp73', 'macosx_10_7_x86_64')
    ----------------------------------------
    ERROR: Failed building wheel for numpy
  Failed to build numpy
  ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
  ----------------------------------------

Code of Conduct

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
uranusjrcommented, Nov 22, 2021

The tag pp37-pypy37_pp73-macosx_10_7_x86_64 is listed in the previously attached pip debug output, so that tag is fine from pip’s perspective. It’s likely a bug in wheel; the would build wheel with unsupported tag was emitted by it.

0reactions
fievelkcommented, Feb 20, 2022

Slightly OT. I was having a similar issue, but it was unrelated to the --use-pep517: I couldn’t install numpy on macOS 12.2.1 Monterey, not even with a simple pip install numpy. My configuration:

> python --version
Python 3.8.12 (9ef55f6fc369, Oct 25 2021, 05:10:01)
[PyPy 7.3.7 with GCC Apple LLVM 13.0.0 (clang-1300.0.29.3)]

And the final output error was the same:

Failed to build numpy ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects

I first ran brew doctor, which showed that my Command Line Tools (XCode) were outdated. Then I just followed the instructions to update them:

sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install

This solved the issue.

I hope this might help others that get here looking for a solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python 3.x - numpy build fail in M1 Big sur 11.1 - Stack Overflow
I have tested it on my M1 with Python 3.9.2, macOS Big Sur (11.5.1), and pip 21.1.3. Just use pip/pip3 to install it....
Read more >
Error installing numpy on m1 Mac using terminal - Python
I get an error trying to install numpy via terminal on m1 mac, Big Sur V11.2.3. Does anyone have any ideas on how...
Read more >
Frequently Asked Questions - PyPy documentation
Does PyPy have a GIL? Why? What about numpy, numpypy, micronumpy? Should I install numpy or numpypy? Is PyPy more clever than CPython...
Read more >
could not build wheels for numpy, which is required to install ...
Under PyPy 7.3.7, Numpy can be built and installed from source with pip install numpy , but it fails to build when being...
Read more >
Installing scipy fails with "Error: 'None' must be ... - Heptapod
I'm trying to install scipy and get it working with pypy. ... MB) Installing build dependencies ... done Getting requirements to build 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