robotpy / robotpy-docs

Unified documentation for RobotPy
Apache License 2.0
10 stars 25 forks source link

[BUG]: can't install on apple silicon Mac KeyError: 'platform macosx-12-arm64 is not supported by robotpy-build! #45

Open mduaneh opened 2 years ago

mduaneh commented 2 years ago

Problem description

Using cached robotpy-wpiutil-2022.3.1.2.tar.gz (12 kB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [31 lines of output] Traceback (most recent call last): File "/private/var/folders/yb/5tvxb35x78x3xljypp4np1fc0000gn/T/pip-build-env-vddho4fx/overlay/lib/python3.9/site-packages/robotpy_build/platforms.py", line 85, in get_platform return _platforms[name] KeyError: 'macosx-12-arm64'

Operating System

MacOS

Installed Python Packages

No response

Reproducible example code

pip3 install robotpy
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
Collecting robotpy
  Using cached robotpy-2022.0.54-py3-none-any.whl (3.2 kB)
Collecting pyfrc<2023.0.0,>=2022.0.0
  Downloading pyfrc-2022.0.2-py3-none-any.whl (48 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.1/48.1 KB 806.2 kB/s eta 0:00:00
Collecting robotpy-wpiutil<2023.0.0,>=2022.3.1.2
  Using cached robotpy-wpiutil-2022.3.1.2.tar.gz (12 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [31 lines of output]
      Traceback (most recent call last):
        File "/private/var/folders/yb/5tvxb35x78x3xljypp4np1fc0000gn/T/pip-build-env-vddho4fx/overlay/lib/python3.9/site-packages/robotpy_build/platforms.py", line 85, in get_platform
          return _platforms[name]
      KeyError: 'macosx-12-arm64'

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/opt/homebrew/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/build_meta.py", line 162, in get_requires_for_build_wheel
          return self._get_build_requires(
        File "/opt/homebrew/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/build_meta.py", line 143, in _get_build_requires
          self.run_setup()
        File "/opt/homebrew/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/build_meta.py", line 267, in run_setup
          super(_BuildMetaLegacyBackend,
        File "/opt/homebrew/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/build_meta.py", line 158, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 5, in <module>
          setup()
        File "/private/var/folders/yb/5tvxb35x78x3xljypp4np1fc0000gn/T/pip-build-env-vddho4fx/overlay/lib/python3.9/site-packages/robotpy_build/setup.py", line 212, in setup
          s = Setup()
        File "/private/var/folders/yb/5tvxb35x78x3xljypp4np1fc0000gn/T/pip-build-env-vddho4fx/overlay/lib/python3.9/site-packages/robotpy_build/setup.py", line 46, in __init__
          self.platform = get_platform()
        File "/private/var/folders/yb/5tvxb35x78x3xljypp4np1fc0000gn/T/pip-build-env-vddho4fx/overlay/lib/python3.9/site-packages/robotpy_build/platforms.py", line 87, in get_platform
          raise KeyError(f"platform {name} is not supported by robotpy-build!")
      KeyError: 'platform macosx-12-arm64 is not supported by robotpy-build!'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
virtuald commented 2 years ago

WPILib does not currently support apple arm, you'll need to use a VM or something else.

TheTripleV commented 2 years ago

WPILib and by extension robotpy are currently only distributed for x86/64 architectures. arm64 is not supported. Please install the x64 version of python and try again.

virtuald commented 2 years ago

Oh interesting, do you think the x64 python would work on an Apple ARM machine?

TheTripleV commented 2 years ago

I've heard that x64 WPILib works fine through Rosetta so am assuming Python would too. I don't have an ARM Mac to try for myself.

mduaneh commented 2 years ago

I haven't tried it yet, but you'd want to start by doing something like: arch -x86_64 /usr/local/bin/brew install python

virtuald commented 2 years ago

Any luck?

mduaneh commented 2 years ago

I already had an x86 version of python installed using the command above.