Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation error with setuptools==60.1.0 #157

Closed
nzw0301 opened this issue Dec 24, 2021 · 7 comments · Fixed by #159
Closed

Installation error with setuptools==60.1.0 #157

nzw0301 opened this issue Dec 24, 2021 · 7 comments · Fixed by #159

Comments

@nzw0301
Copy link

nzw0301 commented Dec 24, 2021

The latest setuptools has removed get_versions method according to this PR. But mpi4py uses this method for installation as follows:

from distutils import cygwinccompiler as cygcc
cygcc_get_versions = cygcc.get_versions

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:/optuna/optuna/runs/4625423583?check_suite_focus=true.

@dalcinl
Copy link
Member

dalcinl commented Dec 24, 2021

If setuptools will keep breaking APIs, I'll have a hard time keeping things up to date.

@dalcinl
Copy link
Member

dalcinl commented Dec 24, 2021

Closed via #159.

@nzw0301 Thanks for the report!

@dalcinl dalcinl closed this as completed Dec 24, 2021
@nzw0301
Copy link
Author

nzw0301 commented Dec 24, 2021

My pleasure! Thank you so much for your quick fix!

@dalcinl
Copy link
Member

dalcinl commented 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

@nzw0301
Copy link
Author

nzw0301 commented Dec 25, 2021

I tried installing mpi4py using the workaround:

SETUPTOOLS_USE_DISTUTILS=stdlib pip install -r requirements.txt

where requirements.txt contains mpi4py. The installation was completed successfully with the latest setuptools==60.1.0. Thank you for sharing it!

pramodk added a commit to neuronsimulator/nrn-build-ci that referenced this issue Dec 27, 2021
…ion test

 * Building mpi4py from source fails due to setuptools API changes
   see mpi4py/mpi4py#157
 * OpenSSL is required to compile neuron from source with integration
   of tqperf. Wonder if tqperf should be disabled if openssl is not found.
@aced125
Copy link

aced125 commented Dec 27, 2021

can we have a release for this please?

@dalcinl
Copy link
Member

dalcinl commented Jan 5, 2022

olupton pushed a commit to neuronsimulator/nrn-build-ci that referenced this issue Jan 11, 2022
…ion test

 * Building mpi4py from source fails due to setuptools API changes
   see mpi4py/mpi4py#157
 * OpenSSL is required to compile neuron from source with integration
   of tqperf. Wonder if tqperf should be disabled if openssl is not found.
@dalcinl dalcinl unpinned this issue Jun 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants