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.

BUG: pip install SciPy fails under PyPy

See original GitHub issue

Describe your issue.

I’m seeing this in SymPy CI in https://github.com/sympy/sympy/pull/23859. I don’t immediately have a computer on which I can test this with PyPy locally.

Essentially pip install scipy has failed under PyPy with:

        File "/tmp/pip-build-env-mupbdlja/overlay/lib/pypy3.8/site-packages/mesonpy/_tags.py", line 79, in __init__
          f'Unknown Python implementation: {self.implementation}. '
      NotImplementedError: Unknown Python implementation: pypy38. Please report this to https://github.com/FFY00/mesonpy/issues and include information about the Python distribution you are using.

You can see the CI setup for this up to the line that fails here: https://github.com/sympy/sympy/blob/7754d037d97d56de9e1bcecb81ecadd4a2e683be/.github/workflows/runtests.yml#L170-L208

The logs for the failed SciPy build are here: https://github.com/sympy/sympy/runs/7583332309?check_suite_focus=true

I have just confirmed that the same CI setup with scipy!=1.9.0 builds 1.8.1 just fine so it seems to be a problem with the 1.9.0 release.

Reproducing Code Example

# Run on Ubuntu 20.04 under PyPy 3.8.
# There might be more to it than this.
# See the CI config above.
pip install scipy

Error message

+ meson install --destdir /tmp/pip-install-pkqrdcy5/scipy_8a1b991ddd494020a114650533cb4ba6/.mesonpy-ve4kjypi/install
      Traceback (most recent call last):
        File "/opt/hostedtoolcache/PyPy/3.8.13/x64/lib/pypy3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 156, in prepare_metadata_for_build_wheel
          hook = backend.prepare_metadata_for_build_wheel
      AttributeError: module 'mesonpy' has no attribute 'prepare_metadata_for_build_wheel'
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/tmp/pip-build-env-mupbdlja/overlay/lib/pypy3.8/site-packages/mesonpy/__init__.py", line 714, in _calculate_file_abi_tag_heuristic_posix
          return mesonpy._tags.StableABITag(tag)
        File "/tmp/pip-build-env-mupbdlja/overlay/lib/pypy3.8/site-packages/mesonpy/_tags.py", line 39, in __init__
          raise ValueError(f'Invalid PEP 3149 stable ABI tag, expecting pattern `{self._REGEX.pattern}`')
      ValueError: Invalid PEP 3149 stable ABI tag, expecting pattern `^abi(?P<abi_number>[0-9]+)$`
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/opt/hostedtoolcache/PyPy/3.8.13/x64/lib/pypy3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/opt/hostedtoolcache/PyPy/3.8.13/x64/lib/pypy3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/opt/hostedtoolcache/PyPy/3.8.13/x64/lib/pypy3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 160, in prepare_metadata_for_build_wheel
          whl_basename = backend.build_wheel(metadata_directory, config_settings)
        File "/tmp/pip-build-env-mupbdlja/overlay/lib/pypy3.8/site-packages/mesonpy/__init__.py", line 927, in build_wheel
          return project.wheel(out).name
        File "/tmp/pip-build-env-mupbdlja/overlay/lib/pypy3.8/site-packages/mesonpy/__init__.py", line 875, in wheel
          wheel = _WheelBuilder(self).build(self._install_plan, self._copy_files, self._build_dir)
        File "/tmp/pip-build-env-mupbdlja/overlay/lib/pypy3.8/site-packages/mesonpy/__init__.py", line 356, in build
          wheel_file = pathlib.Path(directory, f'{self.name}.whl')
        File "/tmp/pip-build-env-mupbdlja/overlay/lib/pypy3.8/site-packages/mesonpy/__init__.py", line 165, in name
          python_tag=self._project.python_tag,
        File "/tmp/pip-build-env-mupbdlja/overlay/lib/pypy3.8/site-packages/mesonpy/__init__.py", line 657, in python_tag
          selected_tag = self._select_abi_tag()
        File "/tmp/pip-build-env-mupbdlja/overlay/lib/pypy3.8/site-packages/mesonpy/__init__.py", line 779, in _select_abi_tag
          tags = self._files_by_tag()
        File "/tmp/pip-build-env-mupbdlja/overlay/lib/pypy3.8/site-packages/mesonpy/__init__.py", line 759, in _files_by_tag
          tag = self._calculate_file_abi_tag_heuristic(file)
        File "/tmp/pip-build-env-mupbdlja/overlay/lib/pypy3.8/site-packages/mesonpy/__init__.py", line 723, in _calculate_file_abi_tag_heuristic
          return self._calculate_file_abi_tag_heuristic_posix(filename)
        File "/tmp/pip-build-env-mupbdlja/overlay/lib/pypy3.8/site-packages/mesonpy/__init__.py", line 716, in _calculate_file_abi_tag_heuristic_posix
          return mesonpy._tags.LinuxInterpreterTag(tag)
        File "/tmp/pip-build-env-mupbdlja/overlay/lib/pypy3.8/site-packages/mesonpy/_tags.py", line 79, in __init__
          f'Unknown Python implementation: {self.implementation}. '
      NotImplementedError: Unknown Python implementation: pypy38. Please report this to https://github.com/FFY00/mesonpy/issues and include information about the Python distribution you are using.

SciPy/NumPy/Python version information

SciPy 1.9.0, PyPy 3.8

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:5
  • Comments:30 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
mattipcommented, Dec 16, 2022

See https://foss.heptapod.net/pypy/pypy/-/issues/3870. This was fixed on PyPy HEAD.

0reactions
oscarbenjamincommented, Dec 16, 2022

In SymPy’s case in particular I doubt that testing this setup does much besides detecting upstream bugs. You can question the value of that but apparently it picks up things that are not tested in upstream CI e.g. because SciPy CI doesn’t have anything checking the PyPy build itself.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't install Scipy through pip - Stack Overflow
After opening up an issue with the SciPy team, we found that you need to upgrade pip with: pip install --upgrade pip. And...
Read more >
BUG: pip -install scipy failing on PypPy 7.3.7 · Issue #15056
When trying to install scipy on pypy 7.3.7, it fails due to numpy failing to build - this happens even if numpy has...
Read more >
Installing scipy fails with "Error: 'None' must be ... - Heptapod
I'm trying to install scipy and get it working with pypy. I have taken the following steps to install: install pypy3 via debian's...
Read more >
Frequently Asked Questions - SciPy
What is SciPy? SciPy is a set of open source (BSD licensed) scientific and numerical tools for Python. It currently supports special functions,...
Read more >
Frequently Asked Questions - PyPy documentation
Should I install numpy or numpypy? ... How should I report a bug? ... PyPy is a reimplementation of Python in Python, using...
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