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

Error: gyp failed with exit code: 1 no module named 'distutils' #431

Closed
arthurfiorette opened this issue Apr 19, 2024 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@arthurfiorette
Copy link
Member

node_modules/.pnpm/deasync@0.1.29/node_modules/deasync: Running install script, failed in 341ms
.../deasync@0.1.29/node_modules/deasync install$ node ./build.js
│ gyp info it worked if it ends with ok
│ gyp info using node-gyp@9.4.1
│ gyp info using node@21.7.3 | darwin | arm64
│ gyp info find Python using Python version 3.12.2 found at "/opt/homebrew/opt/python@3.12/bin/python3.12"
│ gyp info spawn /opt/homebrew/opt/python@3.12/bin/python3.12
│ gyp info spawn args [
│ gyp info spawn args   '/usr/local/lib/node_modules/pnpm/dist/node_modules/node-gyp/gyp/gyp_main.py',
│ gyp info spawn args   'binding.gyp',
│ gyp info spawn args   '-f',
│ gyp info spawn args   'make',
│ gyp info spawn args   '-I',
│ gyp info spawn args   '/Users/griffith/www/kita-app/node_modules/.pnpm/deasync@0.1.29/node_modules/deasync/build/confi…
│ gyp info spawn args   '-I',
│ gyp info spawn args   '/usr/local/lib/node_modules/pnpm/dist/node_modules/node-gyp/addon.gypi',
│ gyp info spawn args   '-I',
│ gyp info spawn args   '/Users/griffith/Library/Caches/node-gyp/21.7.3/include/node/common.gypi',
│ gyp info spawn args   '-Dlibrary=shared_library',
│ gyp info spawn args   '-Dvisibility=default',
│ gyp info spawn args   '-Dnode_root_dir=/Users/griffith/Library/Caches/node-gyp/21.7.3',
│ gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/pnpm/dist/node_modules/node-gyp',
│ gyp info spawn args   '-Dnode_lib_file=/Users/griffith/Library/Caches/node-gyp/21.7.3/<(target_arch)/node.lib',
│ gyp info spawn args   '-Dmodule_root_dir=/Users/griffith/www/kita-app/node_modules/.pnpm/deasync@0.1.29/node_modules/d…
│ gyp info spawn args   '-Dnode_engine=v8',
│ gyp info spawn args   '--depth=.',
│ gyp info spawn args   '--no-parallel',
│ gyp info spawn args   '--generator-output',
│ gyp info spawn args   'build',
│ gyp info spawn args   '-Goutput_dir=.'
│ gyp info spawn args ]
│ Traceback (most recent call last):
│   File "/usr/local/lib/node_modules/pnpm/dist/node_modules/node-gyp/gyp/gyp_main.py", line 42, in <module>
│     import gyp  # noqa: E402
│     ^^^^^^^^^^
│   File "/usr/local/lib/node_modules/pnpm/dist/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, in <module>
│     import gyp.input
│   File "/usr/local/lib/node_modules/pnpm/dist/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in <module>
│     from distutils.version import StrictVersion
│ ModuleNotFoundError: No module named 'distutils'
│ gyp ERR! configure error 
│ gyp ERR! stack Error: `gyp` failed with exit code: 1
│ gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/pnpm/dist/node_modules/node-gyp/lib/configure…
│ gyp ERR! stack     at ChildProcess.emit (node:events:519:28)
│ gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
│ gyp ERR! System Darwin 23.4.0
│ gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js" "…
│ gyp ERR! cwd /Users/griffith/www/kita-app/node_modules/.pnpm/deasync@0.1.29/node_modules/deasync
│ gyp ERR! node -v v21.7.3
│ gyp ERR! node-gyp -v v9.4.1
│ gyp ERR! not ok 
│ Build failed
└─ Failed in 341ms at /Users/griffith/www/kita-app/node_modules/.pnpm/deasync@0.1.29/node_modules/deasync
@arthurfiorette arthurfiorette added the bug Something isn't working label Apr 19, 2024
@arthurfiorette arthurfiorette self-assigned this Apr 19, 2024
@arthurfiorette
Copy link
Member Author

arthurfiorette commented Apr 19, 2024

To fix this issue, try running one of these. Learn more at nodejs/node-gyp#2869

brew install python-setuptools
# or
brew install python-packaging
# or
python3 -m pip install packaging

Thanks for @guisarria for discovering this out :)

@arthurfiorette
Copy link
Member Author

Fixed since #432, after it removed almost all async/await code

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

1 participant