Skip to content
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

Bad CPU type in executable #75

Open
Alexs9090909 opened this issue Mar 22, 2024 · 4 comments
Open

Bad CPU type in executable #75

Alexs9090909 opened this issue Mar 22, 2024 · 4 comments

Comments

@Alexs9090909
Copy link

Alexs9090909 commented Mar 22, 2024

Hi ! I installed the formatter from pypi (pip3 install c-formatter-42), but when i run the command

c_formatter_42 < format_test.c

i get the following error :

Traceback (most recent call last):
  File "/opt/anaconda3/bin/c_formatter_42", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/anaconda3/lib/python3.11/site-packages/c_formatter_42/__main__.py", line 43, in main
    print(run_all(content), end="")
          ^^^^^^^^^^^^^^^^
  File "/opt/anaconda3/lib/python3.11/site-packages/c_formatter_42/run.py", line 29, in run_all
    content = clang_format(content)
              ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/anaconda3/lib/python3.11/site-packages/c_formatter_42/formatters/clang_format.py", line 65, in clang_format
    process = subprocess.Popen(
              ^^^^^^^^^^^^^^^^^
  File "/opt/anaconda3/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/opt/anaconda3/lib/python3.11/subprocess.py", line 1950, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)

OSError: [Errno 86] Bad CPU type in executable: PosixPath('/opt/anaconda3/lib/python3.11/site-packages/c_formatter_42/data/clang-format-darwin') 

Any idea how to fix that ? I'm on macOS 14.1.1

Thanks a lot for the good work !

@cacharle
Copy link
Collaborator

cacharle commented Mar 22, 2024 via email

@Alexs9090909
Copy link
Author

I have an M2 processor, so it looks like it's ARM yes

@cacharle
Copy link
Collaborator

cacharle commented Mar 22, 2024 via email

@Alexs9090909
Copy link
Author

Ok ! Thanks for your answers !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants