reflex-dev / reflex

πŸ•ΈοΈ Web apps in pure Python 🐍

Home Page:https://reflex.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reflex Init fails on M1 Mac

JacobOgle opened this issue Β· comments

Describe the bug
Attempting to create a new project with reflex init (in both a venv and not) resulting in an error
OSError: [Errno 86] Bad CPU type in executable

This is on a fresh install of Mac OS

ProductName:		macOS
ProductVersion:		14.2.1
BuildVersion:		23C71

To Reproduce
Steps to reproduce the behavior:

  • Code/Link to Repo:

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

────────────────────────────────────────────────────────────── Initializing rfx ───────────────────────────────────────────────────────────────
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/bin/reflex", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/typer/main.py", line 326, in __call__
    raise e
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/typer/main.py", line 309, in __call__
    return get_command(self)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/typer/core.py", line 723, in main
    return _main(
           ^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/typer/core.py", line 193, in _main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/typer/main.py", line 692, in wrapper
    return callback(**use_params)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/reflex/reflex.py", line 124, in init
    _init(name, template, loglevel)
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/reflex/reflex.py", line 92, in _init
    prerequisites.initialize_frontend_dependencies()
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/reflex/utils/prerequisites.py", line 1021, in initialize_frontend_dependencies
    processes.run_concurrently(install_node, install_bun)
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/reflex/utils/processes.py", line 201, in run_concurrently
    with run_concurrently_context(*fns):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/contextlib.py", line 144, in __exit__
    next(self.gen)
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/reflex/utils/processes.py", line 188, in run_concurrently_context
    task.result()
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/reflex/utils/prerequisites.py", line 712, in install_node
    process = processes.new_process(
              ^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/reflex/utils/processes.py", line 152, in new_process
    return fn(args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 1955, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 86] Bad CPU type in executable: '/Users/jdo/Library/Application Support/reflex/fnm/fnm'

Specifics (please complete the following information):

  • Python Version: Python 3.12.3
  • Reflex Version: reflex 0.4.8
  • OS: macOS Sonoma Version 14.2.1 (23C71)
  • Browser (Optional): Safari

Additional context
Add any other context about the problem here.

You'll need to install rosetta 2, as described in the docs: https://reflex.dev/docs/getting-started/installation/#prerequisites

/usr/sbin/softwareupdate --install-rosetta --agree-to-license

(To clarify, only fnm the node package manager requires rosetta 2. It installs a version of node that runs natively on apple silicon)