You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ModuleNotFoundError: No module named 'distutils.msvccompiler' in package build CI #2971
@ryanking13 any ideas? Maybe we need to pin something?
Reacted by nirpodoleanu, Rudolf Dobiáš, Augustin FL, Vincent Houlbrèque, Marianne Corvellec, Didier, Maximilian Knespel, Nicholas Djedjos, Aboud-B, Amir Rubin and 2 more
I think we need to pin the setuptools version. Setuptools embeds distutils in its source code and it seems like they removed some of msvc modules recently:
FYI I also faced this issue and the problem with pinning setuptools is that some packages try to upgrade setuptools in their build process anyway:
Step 9/10 : RUN pip install --ignore-installed implicit==0.4.8 -v
---> Running in 8ed28a7f9227
Using pip 22.2.2 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)
Collecting implicit==0.4.8
Downloading implicit-0.4.8.tar.gz (1.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 1.4 MB/s eta 0:00:00
Installing build dependencies: started
Running command pip subprocess to install build dependencies
Collecting setuptools>=40.8.0
Downloading setuptools-65.0.0-py3-none-any.whl (1.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 1.4 MB/s eta 0:00:00
Collecting wheel
Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel, setuptools
Successfully installed setuptools-65.0.0 wheel-0.37.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Running command Getting requirements to build wheel
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
main()
File "/usr/local/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 "/usr/local/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-_9pio9o2/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 337, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/tmp/pip-build-env-_9pio9o2/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 319, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-_9pio9o2/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 474, in run_setup
super(_BuildMetaLegacyBackend,
File "/tmp/pip-build-env-_9pio9o2/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 334, in run_setup
exec(code, locals())
File "<string>", line 10, in <module>
File "/tmp/pip-install-uil7rlsk/implicit_d921eed9601c457fbaa43fc4ffadd90c/cuda_setup.py", line 6, in <module>
from distutils import ccompiler, errors, msvccompiler, unixccompiler
ImportError: cannot import name 'msvccompiler' from 'distutils' (/tmp/pip-build-env-_9pio9o2/overlay/lib/python3.8/site-packages/setuptools/_distutils/__init__.py)
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /usr/local/bin/python /usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmpvhe7pez9
cwd: /tmp/pip-install-uil7rlsk/implicit_d921eed9601c457fbaa43fc4ffadd90c
Getting requirements to build wheel: finished with status 'error'
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
The command '/bin/sh -c pip install --ignore-installed implicit==0.4.8 -v' returned a non-zero code: 1
I changed my installation to add --no-build-isolation to pip install to overcome this issue, not sure if we'll face any issue later. pip install implicit==0.4.8 --no-build-isolation
Reacted by FOOL, jdln-souza, Cyd La Luz, deep-programmer, abhishek-tcs-rni and Gleb
All users of numpy.distutils should be pinning setuptools, see numpy/numpy#22135 (comment). If they don't and it's a problem for Pyodide, you could indeed consider adding the pin yourself.
Pinning setuptools introduces other issues, e.g. for downstream distributions like Pyodide, Debian, or Fedora. These distributions usually support only one version of a package. Some projects require more recent versions, e.g. setuptools-rust >= 1.4 for pyO3 requires requires setuptools >= 62.4.
There must be ways around that. We've been pinning setuptools in SciPy for a while, and no Linux packager complained. Also, we often require the very latest Cython bug fix release, and that is no problem. In general, if you support only one version of build-time dependencies, you are forcing upgrades of all packages in sync every time there is any breaking change.
Is Pyodide really not able to use two different versions of a pure Python package at build time? (distribution only one version at runtime is a separate matter, and not a problem here)
Is Pyodide really not able to use two different versions of a pure Python package at build time?
We can do that yes. We use pypabuild with build isolation. I think we may need to add some extra logic that inserts a version upper bound if it's consistent. Something like in pseudo code:
Activity
ryanking13 commentedon Aug 15, 2022
I think we need to pin the setuptools version. Setuptools embeds distutils in its source code and it seems like they removed some of msvc modules recently:
pypa/setuptools#3505
aminvakil commentedon Aug 15, 2022
FYI I also faced this issue and the problem with pinning setuptools is that some packages try to upgrade setuptools in their build process anyway:
I changed my installation to add
--no-build-isolationtopip installto overcome this issue, not sure if we'll face any issue later.pip install implicit==0.4.8 --no-build-isolationrth commentedon Aug 15, 2022
Yes, because most projects specify setuptools without pinning it in
pyproject.tomltiran commentedon Aug 16, 2022
I have created a more general issue for the setuptools problem, pypa/setuptools#3532.
nirpodoleanu commentedon Aug 16, 2022
+1
rgommers commentedon Aug 19, 2022
All users of
numpy.distutilsshould be pinningsetuptools, see numpy/numpy#22135 (comment). If they don't and it's a problem for Pyodide, you could indeed consider adding the pin yourself.tiran commentedon Aug 19, 2022
Pinning setuptools introduces other issues, e.g. for downstream distributions like Pyodide, Debian, or Fedora. These distributions usually support only one version of a package. Some projects require more recent versions, e.g. setuptools-rust >= 1.4 for pyO3 requires requires setuptools >= 62.4.
rgommers commentedon Aug 19, 2022
There must be ways around that. We've been pinning setuptools in SciPy for a while, and no Linux packager complained. Also, we often require the very latest Cython bug fix release, and that is no problem. In general, if you support only one version of build-time dependencies, you are forcing upgrades of all packages in sync every time there is any breaking change.
Is Pyodide really not able to use two different versions of a pure Python package at build time? (distribution only one version at runtime is a separate matter, and not a problem here)
hoodmane commentedon Aug 19, 2022
We can do that yes. We use pypabuild with build isolation. I think we may need to add some extra logic that inserts a version upper bound if it's consistent. Something like in pseudo code:
henryiii commentedon Aug 24, 2022
FYI, 65.0.2 restored these removed modules.