-
-
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
macOS 12.3 Beta has removed the Python 2 support: spawn /usr/bin/python ENOENT #6606
Comments
I'm not sure if the current electron-builder/packages/dmg-builder/src/dmg.ts Lines 301 to 304 in b01d522
|
Seems not compatible. Maybe we need to port it to Python 3 first. |
Shot in the dark. Can you add |
Sure. I will test it later. |
# -*- coding: utf-8 -*-
from importlib import reload
# from __future__ import unicode_literals
import os
import re
import sys
reload(sys) # Reload is a hack
# sys.setdefaultencoding('UTF8')
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), "..")))
try:
{}.iteritems
iteritems = lambda x: x.iteritems()
iterkeys = lambda x: x.iterkeys()
except AttributeError:
iteritems = lambda x: x.items()
iterkeys = lambda x: x.keys()
try:
unicode
except NameError:
unicode = str
import biplist
from mac_alias import *
from ds_store import *
from colors import parseColor
try:
from badge import badge
except ImportError:
badge = None
class DMGError(Exception):
pass
def build_dmg():
options = {
'icon': None,
'badge_icon': None,
'sidebar_width': 180,
'arrange_by': None,
'grid_offset': (0, 0),
'grid_spacing': 100.0,
'scroll_position': (0.0, 0.0),
'show_icon_preview': False,
'text_size': os.environ['iconTextSize'],
'icon_size': os.environ['iconSize'],
'include_icon_view_settings': 'auto',
'include_list_view_settings': 'auto',
'list_icon_size': 16.0,
'list_text_size': 12.0,
'list_scroll_position': (0, 0),
'list_sort_by': 'name',
'list_columns': ('name', 'date-modified', 'size', 'kind', 'date-added'),
'list_column_widths': {
'name': 300,
'date-modified': 181,
'date-created': 181,
'date-added': 181,
'date-last-opened': 181,
'size': 97,
'kind': 115,
'label': 100,
'version': 75,
'comments': 300,
},
'list_column_sort_directions': {
'name': 'ascending',
'date-modified': 'descending',
'date-created': 'descending',
'date-added': 'descending',
'date-last-opened': 'descending',
'size': 'descending',
'kind': 'ascending',
'label': 'ascending',
'version': 'ascending',
'comments': 'ascending',
}
}
# Set up the finder data
bwsp = {
'ShowStatusBar': False,
'ContainerShowSidebar': False,
'PreviewPaneVisibility': False,
'SidebarWidth': options['sidebar_width'],
'ShowTabView': False,
'ShowToolbar': False,
'ShowPathbar': False,
'ShowSidebar': False
}
window_x = os.environ.get('windowX')
if window_x:
window_y = os.environ['windowY']
bwsp['WindowBounds'] = '{{%s, %s}, {%s, %s}}' % (window_x,
window_y,
os.environ['windowWidth'],
os.environ['windowHeight'])
arrange_options = {
'name': 'name',
'date-modified': 'dateModified',
'date-created': 'dateCreated',
'date-added': 'dateAdded',
'date-last-opened': 'dateLastOpened',
'size': 'size',
'kind': 'kind',
'label': 'label',
}
icvp = {
'viewOptionsVersion': 1,
'backgroundType': 0,
'backgroundColorRed': 1.0,
'backgroundColorGreen': 1.0,
'backgroundColorBlue': 1.0,
'gridOffsetX': float(options['grid_offset'][0]),
'gridOffsetY': float(options['grid_offset'][1]),
'gridSpacing': float(options['grid_spacing']),
'arrangeBy': str(arrange_options.get(options['arrange_by'], 'none')),
'showIconPreview': options['show_icon_preview'] == True,
'showItemInfo': False,
'labelOnBottom': True,
'textSize': float(options['text_size']),
'iconSize': float(options['icon_size']),
'scrollPositionX': float(options['scroll_position'][0]),
'scrollPositionY': float(options['scroll_position'][1])
}
columns = {
'name': 'name',
'date-modified': 'dateModified',
'date-created': 'dateCreated',
'date-added': 'dateAdded',
'date-last-opened': 'dateLastOpened',
'size': 'size',
'kind': 'kind',
'label': 'label',
'version': 'version',
'comments': 'comments'
}
default_widths = {
'name': 300,
'date-modified': 181,
'date-created': 181,
'date-added': 181,
'date-last-opened': 181,
'size': 97,
'kind': 115,
'label': 100,
'version': 75,
'comments': 300,
}
default_sort_directions = {
'name': 'ascending',
'date-modified': 'descending',
'date-created': 'descending',
'date-added': 'descending',
'date-last-opened': 'descending',
'size': 'descending',
'kind': 'ascending',
'label': 'ascending',
'version': 'ascending',
'comments': 'ascending',
}
lsvp = {
'viewOptionsVersion': 1,
'sortColumn': columns.get(options['list_sort_by'], 'name'),
'textSize': float(options['list_text_size']),
'iconSize': float(options['list_icon_size']),
'showIconPreview': options['show_icon_preview'],
'scrollPositionX': options['list_scroll_position'][0],
'scrollPositionY': options['list_scroll_position'][1],
'useRelativeDates': True,
'calculateAllSizes': False,
}
lsvp['columns'] = {}
cndx = {}
for n, column in enumerate(options['list_columns']):
cndx[column] = n
width = options['list_column_widths'].get(column, default_widths[column])
asc = 'ascending' == options['list_column_sort_directions'].get(column, default_sort_directions[column])
lsvp['columns'][columns[column]] = {
'index': n,
'width': width,
'identifier': columns[column],
'visible': True,
'ascending': asc
}
n = len(options['list_columns'])
for k in iterkeys(columns):
if cndx.get(k, None) is None:
cndx[k] = n
width = default_widths[k]
asc = 'ascending' == default_sort_directions[k]
lsvp['columns'][columns[column]] = {
'index': n,
'width': width,
'identifier': columns[column],
'visible': False,
'ascending': asc
}
n += 1
default_view = 'icon-view'
views = {
'icon-view': b'icnv',
'column-view': b'clmv',
'list-view': b'Nlsv',
'coverflow': b'Flwv'
}
icvl = (b'type', views.get(default_view, 'icnv'))
include_icon_view_settings = default_view == 'icon-view' \
or options['include_icon_view_settings'] not in \
('auto', 'no', 0, False, None)
include_list_view_settings = default_view in ('list-view', 'coverflow') \
or options['include_list_view_settings'] not in \
('auto', 'no', 0, False, None)
try:
background_bmk = None
background_color = os.environ.get('backgroundColor')
background_file = os.environ.get('backgroundFile')
if background_color:
c = parseColor(background_color).to_rgb()
icvp['backgroundType'] = 1
icvp['backgroundColorRed'] = float(c.r)
icvp['backgroundColorGreen'] = float(c.g)
icvp['backgroundColorBlue'] = float(c.b)
elif background_file:
alias = Alias.for_file(background_file)
background_bmk = Bookmark.for_file(background_file)
icvp['backgroundType'] = 2
icvp['backgroundImageAlias'] = biplist.Data(alias.to_bytes())
image_dsstore = os.path.join(os.environ['volumePath'], '.DS_Store')
f = "icon_locations = {\n" + os.environ['iconLocations'] + "\n}"
exec (f, options, options)
with DSStore.open(image_dsstore, 'w+') as d:
d['.']['vSrn'] = ('long', 1)
d['.']['bwsp'] = bwsp
if include_icon_view_settings:
d['.']['icvp'] = icvp
if background_bmk:
d['.']['pBBk'] = background_bmk
if include_list_view_settings:
d['.']['lsvp'] = lsvp
d['.']['icvl'] = icvl
d['.background']['Iloc'] = (2560, 170)
d['.DS_Store']['Iloc'] = (2610, 170)
d['.fseventsd']['Iloc'] = (2660, 170)
d['.Trashes']['Iloc'] = (2710, 170)
d['.VolumeIcon.icns']['Iloc'] = (2760, 170)
for k, v in iteritems(options['icon_locations']):
d[k]['Iloc'] = v
except:
raise
build_dmg() I followed the exception instruction from |
Should be working correctly, the only difference is depending upon which version of python you're using.
https://stackoverflow.com/a/33409066 I'll need to figure out a way to support both python 2 and python 3. I'm not sure what the other python scripts in the |
I think this might do the trick:
|
…3+ which has entirely removed python2 (fixes: #6606)
Not only this. I also commented out |
Great point, we can add that as an if-else statement as I think we should continue supporting Python 2 since it seems unnecessary to drop support for it. |
Hi, this has not resolved the issue for me, I get same error on electron builder I cannot build my app I always get: |
Ok, it's working again in version |
Versions lower than 23.0.2 don't work on newest macOS, see: * electron-userland/electron-builder#6732 * electron-userland/electron-builder#6606
Versions lower than 23.0.2 don't work on newest macOS, see: * electron-userland/electron-builder#6732 * electron-userland/electron-builder#6606
* Take `localClusterUri` into account in `QuickInput` (#679) * Display cluster name for each connection * Automatically try to connect a connection when possible * Update connection icon * Always use root cluster URI to obtain `documentsService` in `useServerConnect` * Don't close the tab on non-zero exit code * Autocomplete database names for tsh proxy db * Change placeholder text in `ClusterAdd` * Show leaf cluster name when possible in Connections list * Hide kubes and apps * Force `TopBar` items to take full height * Change shortcut to open `QuickInput` * Update electron-builder to 23.0.3 Versions lower than 23.0.2 don't work on newest macOS, see: * electron-userland/electron-builder#6732 * electron-userland/electron-builder#6606 * remove `Navigator` code (#685) * Prevent breaking layout on long cluster name (#688) * Show username when possible in identity list (#687) * Update command for updating proto files * Update protobufs for Teleterm (LoginRequest params) This commit removes a bunch of unused protobufs and also updates some of those that got updated on the teleterm branch in the teleport repo. The biggest change from all of them is that LoginRequest now has oneof on Sso and Local. [1] This is because a login request should have either Sso or Local params, but not both at the same time. The previous implementation called both `setSso` and `setLogin` on the same object. This no longer works with the use of `oneof`, because calling `setLogin` after `setSso` would clear the `Sso` params. [2] [1] gravitational/teleport#10286 (comment) [2] https://developers.google.com/protocol-buffers/docs/proto3#oneof_features * Render ssh menu item as `NavLink` only when URL is provided * Use connection dropdown instead of modal for supplying SSH username * Adjust `Identity` layout, combine `logout` and `clusterRemove` into a single action * Change command `cluster-remove` to `cluster-logout` * Apply `Identity` design changes * Enable `babel-plugin-styled-components` in production and tests (#697) * Make connections icon bigger * Properly use `css` prop Co-authored-by: Grzegorz Zdunek <gzdunek@users.noreply.github.com> Co-authored-by: Grzegorz Zdunek <grzegorz.zdunek@goteleport.com>
|
|
thanks a lot, I resolve this problem by this configuration in package.json: {
...
"devDependencies": {
...
"vue-cli-plugin-electron-builder": "^2.1.1",
},
"resolutions": {
"vue-cli-plugin-electron-builder/electron-builder": "^23.0.6"
},
...
}
|
I've updated macOS 12.6, I'm using electron-builder version-22.8.1 and facing same problem of missing python on path: /usr/bin/python I've changed the hard coded path of /usr/bin/python to /usr/local/bin/python inside package dmg-builder in file out/dmg.js. now try to build and it worked perfectly.
|
Hello, I have solved this problem on macbook using ASDF, I set the python version in the shell where I am running the build. ex: |
Versions lower than 23.0.2 don't work on newest macOS, see: * electron-userland/electron-builder#6732 * electron-userland/electron-builder#6606
Versions lower than 23.0.2 don't work on newest macOS, see: * electron-userland/electron-builder#6732 * electron-userland/electron-builder#6606
MacOS is specified by version number explicitly because tag "macos-latest" refers to macos-11 or macos-12 randomly during GitHub action's transition while macos 12 removed Python 2 which is required by electron-builder. Since latest electron-builder has supported python3, this hotfix will not introduce python2 in host but downgrade it to macos 12 Ref: electron-userland/electron-builder#6606
and equally importantly upgrade electron-builder to 23.6+ per this bug electron-userland/electron-builder#6606
MacOS is specified by version number explicitly because tag "macos-latest" refers to macos-11 or macos-12 randomly during GitHub action's transition while macos 12 removed Python 2 which is required by electron-builder. Since latest electron-builder has supported python3, this hotfix will not introduce python2 in host but downgrade it to macos 12 Ref: electron-userland/electron-builder#6606
MacOS is specified by version number explicitly because tag "macos-latest" refers to macos-11 or macos-12 randomly during GitHub action's transition while macos 12 removed Python 2 which is required by electron-builder. Since latest electron-builder has supported python3, this hotfix will not introduce python2 in host but downgrade it to macos 12 Ref: electron-userland/electron-builder#6606
You could also just use python3. Change the default python to python3's, for example |
MacOS is specified by version number explicitly because tag "macos-latest" refers to macos-11 or macos-12 randomly during GitHub action's transition while macos 12 removed Python 2 which is required by electron-builder. Since latest electron-builder has supported python3, this hotfix will not introduce python2 in host but downgrade it to macos 12 Ref: electron-userland/electron-builder#6606
MacOS is specified by version number explicitly because tag "macos-latest" refers to macos-11 or macos-12 randomly during GitHub action's transition while macos 12 removed Python 2 which is required by electron-builder. Since latest electron-builder has supported python3, this hotfix will not introduce python2 in host but downgrade it to macos 12 Ref: electron-userland/electron-builder#6606
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
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
macOS 12.3 has removed the Python 2 support; thus,
/usr/bin/python
has been removed. electron-builder tries to call/usr/bin/python
and it throwsError: Exit code: ENOENT. spawn /usr/bin/python ENOENT
.Reproducible Step
Full Log
The text was updated successfully, but these errors were encountered: