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] 60.1.0: Installing mpi4py fails with latest setuptools

See original GitHub issue

setuptools version

60.1.0

Python version

3.8

OS

Linux (Ubuntu)

Additional environment information

No response

Description

Installing mpi4py started to fail with the release of setuptools==60.1.0. It works with setuptools==60.0.4. Is 60.1.0 expected to be a breaking release version?

$ pip install -v mpi4py
Using pip 21.3.1 from .../venv-mpi4py/lib/python3.8/site-packages/pip (python 3.8)
Collecting mpi4py
  Using cached mpi4py-3.1.3.tar.gz (2.5 MB)
  Running command .../venv-mpi4py/bin/python /tmp/pip-standalone-pip-fmkquq0f/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-nun8azx9/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools >= 40.9.0' wheel
  Collecting setuptools>=40.9.0
    Using cached setuptools-60.1.0-py3-none-any.whl (952 kB)
  Collecting wheel
    Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
  Installing collected packages: wheel, setuptools
  Successfully installed setuptools-60.1.0 wheel-0.37.1
  Installing build dependencies ... done
  Running command .../venv-mpi4py/bin/python .../venv-mpi4py/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmputajppc5
  Traceback (most recent call last):
    File ".../venv-mpi4py/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
      main()
    File ".../venv-mpi4py/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File ".../venv-mpi4py/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/tmp/pip-build-env-nun8azx9/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 162, in get_requires_for_build_wheel
      return self._get_build_requires(
    File "/tmp/pip-build-env-nun8azx9/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 143, in _get_build_requires
      self.run_setup()
    File "/tmp/pip-build-env-nun8azx9/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 158, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 462, in <module>
      from mpidistutils import setup
    File "/tmp/pip-install-k7kbt967/mpi4py_fa187d0418384267943227507227365d/conf/mpidistutils.py", line 29, in <module>
      cygcc_get_versions = cygcc.get_versions
  AttributeError: module 'setuptools._distutils.cygwinccompiler' has no attribute 'get_versions'
  Getting requirements to build wheel ... error

Something must have changed in setuptools that broke mpi4py/conf/mpidistutils.py.

Expected behavior

Installing the package mpi4py should work as with setuptools 60.0.x, given this is a minor version increment.

How to Reproduce

pip install --upgrade pip setuptools pip install mpi4py

Output

  AttributeError: module 'setuptools._distutils.cygwinccompiler' has no attribute 'get_versions'

Code of Conduct

  • I agree to follow the PSF Code of Conduct

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
jaracocommented, Dec 29, 2021

I’m going to go ahead and apply the patch I proposed above.

2reactions
jaracocommented, Dec 29, 2021

It sounds like the use-case for mpi4py is simply to monkeypatch, so I’d not bother restoring the implementation. I’d just create an attribute with a comment:

get_versions = None
"""
A stand-in for the previous get_versions() function to prevent failures
when monkeypatched. See pypa/setuptools#2969.
"""
Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when installing mpi4py - python - Stack Overflow
I'm trying to install mpi4py using pip install mpi4py, but I'm getting the following error: error: Cannot find 'mpi. h' header. Check your...
Read more >
Build failure with python installed from conda - mpi4py
I am using openmpi-1.8.4 and intel compiler version 15.0.3. I tried both pip and setup.py (mpi4py version 3.0.2), but both failed.
Read more >
Problem with installing mpi4py - Google Groups
Hi all i successfully installed mpi4py on one of my comps. but while trying on other i got following error root@MyPC:/home/sarath/Downloads/mpi4py-1.3.1# ...
Read more >
nzw0301 (Kento Nozawa) · GitHub
Installation error with setuptools==60.1.0. The latest setuptools has removed get_versions method according to this PR. But mpi4py uses this method for ...
Read more >
How to install the mpi4py package ? | Data Science ... - Kaggle
@marwatrigui : I tried to install it in an empty new notebook in Kaggle. ... error: Cannot compile MPI programs. Check your configuration!!!...
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