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.

`ModuleNotFoundError: No module named 'distutils.msvccompiler'` in package build CI

See original GitHub issue

🐛 Bug

Several different packages have failed with ModuleNotFoundError: No module named 'distutils.msvccompiler'. See for instance: https://app.circleci.com/pipelines/github/hoodmane/pyodide/3667/workflows/dd548c6b-f1c8-40d3-88f5-e71573bf4934/jobs/43716

@ryanking13 any ideas? Maybe we need to pin something?

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:5
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
hoodmanecommented, Aug 19, 2022

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:

setuptools_json = fetch_json("pypi.org/setuptools/json")
setuptools_vers = get_versions(setuptools_json)

lt_65_vers = [v for v in setuptools_vers if v in setuptools_constrait and v.major<65]
if less_than_65_vers:
   setuptools_constraint = "setuptools=="+max(less_than_65_vers)
1reaction
ryanking13commented, 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:

https://github.com/pypa/setuptools/pull/3505

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - ModuleNotFoundError: No module named 'distutils.util'
The module not found likely means the packages aren't installed. sudo apt-get install python3-distutils sudo apt-get install python3-apt.
Read more >
Unable to install python script due to "numpy.distutils ...
I've seen an answer (statsmodels installation: No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils) where ...
Read more >
Fresh install error: No module named 'distutils.msvccompiler'
I am a complete newbie in pymc, and after listening to @AlexAndorra non-stop in his podcast about the marvelous of such a package,...
Read more >
History - setuptools 65.6.3.post20221216 documentation
#3624: Fixed editable install for multi-module/no-package src -layout projects. ... builds on Python 3.9 not installed by homebrew (pypa/distutils#158).
Read more >
no module named distutils.util" creating new project : PY-49687
"ModuleNotFoundError: no module named distutils.util" creating new project ... Dear Pycharm team,. After downloading the latest version of Pycharm Profesional ( ...
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