-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Exit code: ENOENT. spawn /usr/bin/python error after updating macOS #6726
Comments
I'm investigating this issue right now since it's blocking my work. Here's what I've learned:
So presumably, setting |
FYI, this may be a dupe of #6606 |
You are right, upgrading to 23.0.2 fixed this issue. I had searched for this for some time but I couldn't find anything, thanks for the help! |
electron-userland/electron-builder#6726 This commit also updated the others packages
@scowalt did you manage to make it work by setting the |
how to upgrade 23.0.2 |
|
|
I ended up just updating @hjMaGitHub , it looks like |
Summary: Fix build on new MacOS electron-userland/electron-builder#6726 Reviewed By: passy Differential Revision: D35211540 fbshipit-source-id: f59828f008482c503c260ca5f9bc625ca694e1be
if you use yarn,after install python2.7.18 and fix the python's path, you can add this code in package.json to fix it yarn is ok, I'm not try it in npm |
npm (native) solution to this are npm overrides. See example here. |
This should work 😁. *Note: Python v2 must be installed, and check if this directory exists by pressing "sudo cd usr/bin/python2".
|
+1 |
I had just |
After updating electron-builder I had to updating dmg-builder to successfully fix dmg creation. |
Upgrade electron-builder to see if this fixes the issue. According to electron-userland/electron-builder#6726
It worked for me!!! nklayman/vue-cli-plugin-electron-builder#1701 (comment) |
thx @lylyong the resolution |
As on my Mac, It works after next steps
|
This fixes the error with building in macos more info here: electron-userland/electron-builder#6726
The GitHub-hosted runners began experiencing issues while building macOS desktop distributions, exclusively affecting the macOS environment. The Ubuntu and Windows environments remained unaffected. The logs highlighted the absence of Python in the macOS environment, which resulted in build failure: ```sh Error: Exit code: ENOENT. spawn /usr/bin/python ENOENT ``` Since the `electron-builder` package uses Python scripts to create DMG disk images for macOS distributions, Python is needed for building the application. However, electron-builder uses Python 2.X meanwhile modern macOS versions have removed Python 2.X from the operating system on default installation. Although this issue was resolved in `electron-builder` version 23,, `vue-cli-plugin-electron-builder` continues to use version 22. Due to a lack of maintenance, the package is unlikely to receive updates. This commit forces `vue-cli-plugin-electron-builder` to use the latest `electron-builder` which resolves the macOS distribution build failure. In CI process, GitHub-hosted runners start to fail when building macOS desktop distributions. It is only observered in the macOS environment while the application is built successfully in both the Ubuntu and Windows environments. The error message in the logs indicated that Python was not found in the macOS environment: ```sh Error: Exit code: ENOENT. spawn /usr/bin/python ENOENT ``` `electron-builder` package uses Python scripts for certain operations, specifically for creating DMG disk images for macOS distributions. As a result, Python is a necessary dependency when building the application for macOS. `electron-builder` has fixed this starting from version 23, but vue-cli-plugin-electron-builder still refers to version 22 and it is unmaintained and not likely to get updates. The solution is to add a step in the GitHub Actions workflow to set up Python in the macOS environment. `actions/setup-python` sets up the Python environment in the runner if the OS is macOS. This change does not impact the Ubuntu and Windows environments as the setup-python step is conditionally executed only for macOS. The addition of Python to the macOS environment in CI process has resolved the build failure issue for the macOS distribution. See also: - electron-userland/electron-builder#6606 - electron-userland/electron-builder#6726 - electron-userland/electron-builder#6732 - nklayman/vue-cli-plugin-electron-builder#1691 - nklayman/vue-cli-plugin-electron-builder#1701
I also updates the `package-lock.json` to the v3 format. Now the app compiles again, too! Looks like I ran into this issue with Electron-Builder here, I'm pretty sure. electron-userland/electron-builder#6726
The GitHub-hosted runners began experiencing issues while building macOS desktop distributions, exclusively affecting the macOS environment. The Ubuntu and Windows environments remained unaffected. The logs highlighted the absence of Python in the macOS environment, which resulted in build failure: ```sh Error: Exit code: ENOENT. spawn /usr/bin/python ENOENT ``` Since the `electron-builder` package uses Python scripts to create DMG disk images for macOS distributions, Python is needed for building the application. However, electron-builder uses Python 2.X meanwhile modern macOS versions have removed Python 2.X from the operating system on default installation. Although this issue was resolved in `electron-builder` version 23,, `vue-cli-plugin-electron-builder` continues to use version 22. Due to a lack of maintenance, the package is unlikely to receive updates. This commit forces `vue-cli-plugin-electron-builder` to use the latest `electron-builder` which resolves the macOS distribution build failure. In CI process, GitHub-hosted runners start to fail when building macOS desktop distributions. It is only observered in the macOS environment while the application is built successfully in both the Ubuntu and Windows environments. The error message in the logs indicated that Python was not found in the macOS environment: ```sh Error: Exit code: ENOENT. spawn /usr/bin/python ENOENT ``` `electron-builder` package uses Python scripts for certain operations, specifically for creating DMG disk images for macOS distributions. As a result, Python is a necessary dependency when building the application for macOS. `electron-builder` has fixed this starting from version 23, but vue-cli-plugin-electron-builder still refers to version 22 and it is unmaintained and not likely to get updates. The solution is to add a step in the GitHub Actions workflow to set up Python in the macOS environment. `actions/setup-python` sets up the Python environment in the runner if the OS is macOS. This change does not impact the Ubuntu and Windows environments as the setup-python step is conditionally executed only for macOS. The addition of Python to the macOS environment in CI process has resolved the build failure issue for the macOS distribution. See also: - electron-userland/electron-builder#6606 - electron-userland/electron-builder#6726 - electron-userland/electron-builder#6732 - nklayman/vue-cli-plugin-electron-builder#1691 - nklayman/vue-cli-plugin-electron-builder#1701
2024 and none of the mentioned solutions above worked for me. PS: i am using the eletron-builder in a vuejs app, just FYI Problem: Firstly, this is a python problem like mentioned above, however since MacOS doesn't ship with default python anymore it's an issue. It seems like the Solution:
// other dev dependencies
"vue-cli-plugin-electron-builder": "~2.1.1"
},
"overrides": {
"vue-cli-plugin-electron-builder": {
"electron-builder": "^23.0.6"
}
} Works like charm✨ PS: Another untested solution which could theoretically work is, you should find a way to install python 2.x (I think) and update the environment variables so it can find it in the path |
which python/Users/async/.pyenv/shims/python export PYTHON_PATH=/Users/async/.pyenv/shims/pythonnpm run build:xxx...Find the python path on your machine and export PYTHON_PATH when npm run build |
I recently updated my MacBook Air M1 (macOS Monterey) to 12.3 and started receiving this error when running "electron-builder":
The text was updated successfully, but these errors were encountered: