Skip to content

Commit

Permalink
server: detect python architecture vs machine mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Mar 26, 2023
1 parent 76bf1d0 commit ef16ca8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions server/python/plugin_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,17 @@ def onProxySerialization(value: Any, proxyId: str):

plugin_volume = os.environ.get('SCRYPTED_PLUGIN_VOLUME')

# it's possible to run 32bit docker on aarch64, which cause pip requirements
# to fail because pip only allows filtering on machine, even if running a different architeture.
# this will cause prebuilt wheel installation to fail.
if platform.machine() == 'aarch64' and platform.architecture()[0] == '32bit':
print('Python machine vs architecture mismatch detected.')
print('If Scrypted is running in docker, the docker version may be 32bit while the host kernel is 64bit.')
print('This may be resolved by reinstalling a 64bit docker.')
print('The docker architecture can be checked with the command: "file $(which docker)"')
print('The host architecture can be checked with: "uname -m"')
raise Exception('Python machine/architecture mismatch')

python_version = 'python%s' % str(
sys.version_info[0])+"."+str(sys.version_info[1])
print('python version:', python_version)
Expand Down

0 comments on commit ef16ca8

Please sign in to comment.