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.

Installation error with `setuptools==60.1.0`

See original GitHub issue

The latest setuptools has removed get_versions method according to this PR. But mpi4py uses this method for installation as follows: https://github.com/mpi4py/mpi4py/blob/499468c8d1af7746841bdc7ddc6c6aefe61be78a/conf/mpidistutils.py#L32-L33

As a result, I saw the following error when I tries installing mpi4py

#9 49.81   Traceback (most recent call last):
#9 49.81     File "/usr/local/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
#9 49.81       main()
#9 49.81     File "/usr/local/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
#9 49.81       json_out['return_val'] = hook(**hook_input['kwargs'])
#9 49.81     File "/usr/local/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
#9 49.81       return hook(config_settings)
#9 49.81     File "/tmp/pip-build-env-24728uki/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 163, in get_requires_for_build_wheel
#9 49.81       config_settings, requirements=['wheel'])
#9 49.81     File "/tmp/pip-build-env-24728uki/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 143, in _get_build_requires
#9 49.81       self.run_setup()
#9 49.81     File "/tmp/pip-build-env-24728uki/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 158, in run_setup
#9 49.81       exec(compile(code, __file__, 'exec'), locals())
#9 49.81     File "setup.py", line 462, in <module>
#9 49.81       from mpidistutils import setup
#9 49.81     File "/tmp/pip-install-e88xwuui/mpi4py_a99d99dc8e2b489fbd0a8152611b34c3/conf/mpidistutils.py", line 29, in <module>
#9 49.81       cygcc_get_versions = cygcc.get_versions
#9 49.81   AttributeError: module 'setuptools._distutils.cygwinccompiler' has no attribute 'get_versions'

More detailed installation procedure is found in https://github.com/optuna/optuna/runs/4625423583?check_suite_focus=true.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
aced125commented, Dec 27, 2021

can we have a release for this please?

4reactions
dalcinlcommented, Dec 25, 2021

Workaround

Set the environment variable SETUPTOOLS_USE_DISTUTILS to stdlib, next install mpi4py.

For example, in a bash or zsh shell:

export SETUPTOOLS_USE_DISTUTILS=stdlib
pip install mpi4py

or

SETUPTOOLS_USE_DISTUTILS=stdlib pip install mpi4py

or using the env command

env SETUPTOOLS_USE_DISTUTILS=stdlib pip install mpi4py
Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] 60.1.0: Installing mpi4py fails with latest setuptools #2969
setuptools version 60.1.0 Python version 3.8 OS Linux (Ubuntu) Additional environment information No response Description Installing mpi4py ...
Read more >
setuptools 6.0.1 - PyPI
Easily download, build, install, upgrade, and uninstall Python packages. ... Issue #258: Setuptools now patches distutils msvc9compiler to recognize the ...
Read more >
Latest version install script errors on installation... - pixls.us
I am getting the followig error when installing the latest RFD via provided ... Successfully installed pip-21.3.1 setuptools-60.1.0 Restarting script using ...
Read more >
AttributeError: module 'setuptools._distutils' has no attribute ...
python3 -m pip install setuptools==59.5.0. pip successfully installed this version: Successfully installed setuptools-60.1.0 instead of ...
Read more >
Files :: Anaconda.org
Type Size Uploaded Uploader Downloads Labels conda 618.9 kB 2 days and 15 hours ago cf‑staging 214786 main conda 612.8 kB 28 days and 18...
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