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

Runner macos-13-arm64 20231024.2: ModuleNotFoundError: No module named 'distutils' #2958

Open
jozefizso opened this issue Oct 28, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@jozefizso
Copy link

Describe the bug
Our builds started to fail with error ModuleNotFoundError: No module named 'distutils'.

This error occurs in macos-13-arm64 v20231024.2 images. There were no issues with previous images including the v20231017.1

To Reproduce
Create a workflow which installs the appdmg@0.6.6 npm package.

- name: setup appdmg
  run: npm install -g appdmg@0.6.6

Run the workflow on macos-13-xlarge runner. It will use the macos-13-arm64 20231024.2 which breaks existing workflows.

Expected behavior
The appdmg@0.6.6 would install normally as on previous images.

Runner Version and Platform

Version of your runner? 2.311.0

OS of the machine running the runner? macOS

What's not working?

npm ERR! code 1
npm ERR! path /opt/homebrew/lib/node_modules/appdmg/node_modules/macos-alias
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.4.0
npm ERR! gyp info using node@18.18.2 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.12.0 found at "/usr/local/bin/python3"
npm ERR! gyp http GET https://nodejs.org/download/release/v18.18.2/node-v18.18.2-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v18.18.2/node-v18.18.2-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v18.18.2/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v18.18.2/SHASUMS256.txt
npm ERR! gyp info spawn /usr/local/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/opt/homebrew/Cellar/node@18/18.18.2/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/opt/homebrew/lib/node_modules/appdmg/node_modules/macos-alias/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/opt/homebrew/Cellar/node@18/18.18.2/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/runner/Library/Caches/node-gyp/18.18.2/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/Users/runner/Library/Caches/node-gyp/18.18.2',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/opt/homebrew/Cellar/node@18/18.18.2/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/runner/Library/Caches/node-gyp/18.18.2/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/opt/homebrew/lib/node_modules/appdmg/node_modules/macos-alias',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! Traceback (most recent call last):
npm ERR!   File "/opt/homebrew/Cellar/node@18/18.18.2/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 42, in <module>
npm ERR!     import gyp  # noqa: E402
npm ERR!     ^^^^^^^^^^
npm ERR!   File "/opt/homebrew/Cellar/node@18/18.18.2/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, in <module>
npm ERR!     import gyp.input
npm ERR!   File "/opt/homebrew/Cellar/node@18/18.18.2/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in <module>
npm ERR!     from distutils.version import StrictVersion
npm ERR! ModuleNotFoundError: No module named 'distutils'
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/opt/homebrew/Cellar/node@18/18.18.2/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:325:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:517:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:292:12)
npm ERR! gyp ERR! System Darwin 22.6.0
npm ERR! gyp ERR! command "/opt/homebrew/Cellar/node@18/18.18.2/bin/node" "/opt/homebrew/Cellar/node@18/18.18.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /opt/homebrew/lib/node_modules/appdmg/node_modules/macos-alias
npm ERR! gyp ERR! node -v v18.18.2
npm ERR! gyp ERR! node-gyp -v v9.4.0
npm ERR! gyp ERR! not ok
@jozefizso jozefizso added the bug Something isn't working label Oct 28, 2023
@bret-mobeus
Copy link

I have tried all kinds of trickery and work arounds to get distutils installed on the runner in my workflw, but I keep getting stifled by all kinds of complaints when doing so, such as;

ERROR: Could not find a version that satisfies the requirement python3-distutils (from versions: none)
ERROR: No matching distribution found for python3-distutils

Any ideas anyone???

@bret-mobeus
Copy link

both of these fail with the above message;

          sudo -H pip install python3-distutils
           sudo -H pip install python-distutils

@bret-mobeus
Copy link

@jozefizso I fixed my identical problem by doing this before my npm install;

          sudo -H pip install setuptools

@XilinJia
Copy link

@jozefizso I fixed my identical problem by doing this before my npm install;

          sudo -H pip install setuptools

This worked for me. Thank you

obra added a commit to keyboardio/Chrysalis that referenced this issue Dec 18, 2023
@nkallen
Copy link

nkallen commented Apr 5, 2024

I can't get this to work unfortunately, including with

      sudo -H pip install setuptools

This just broke today for me on macOS-latest-xlarge

@dj-fiorex
Copy link

i can't neither build on macos latest. i'm using electron-forge and need to build node-opcua library

@nkallen
Copy link

nkallen commented May 14, 2024

        - uses: actions/setup-python@v5
          with:
            python-version: '3.10'
            cache: 'pip'
        - name: Install Python setup tools
          run: |
              pip install setuptools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants