Open Ashrit-Yarava opened 2 years ago
Known issue, I get the same, it may be because of the M1 chip
Same issue here on Mac OS Big Sur. I have an M1 chip though which seems to be the source of the cause.
Same here, Mac OS Monterey (M1 chip)
However, for me, I get a segfault when importing the library:
python
Python 3.9.10 (main, Jan 15 2022, 11:40:53)
[Clang 13.0.0 (clang-1300.0.29.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import keyboard
zsh: segmentation fault python
I too receive the segmentation fault error. Any alternatives or ETA is known?
same here, segmentation fault error whenever I try to run a program with import keyboard
It uses ctypes
, so it needs an update before supporting an ARM-based CPU like M1.
Unfortunately I don't have a Mac to develop on, so I rely 100% on community contributions for Mac support :(
Hi @boppreh, I have Mac M1 without Rosetta i.e. ARM64 architecture type. Can you please assist me on how and where to make the changes?
@rasoolmohammedy It's somewhere in https://github.com/boppreh/keyboard/blob/master/keyboard/_darwinkeyboard.py , though where exactly needs more testing.
Some places that could be:
It'd suggest it running it with pydb step by step during initialization. That should tell you which of the above are causing problems.
@Ashrit-Yarava @rasoolmohammedy from python 3.10.2 onwards universal binaries are provided, so that if you are facing an issue with importing modules that crash on segmentation fault you can simply run your program likewise
python3-intel64 yourprogram.py
I tried this with a program that imports keyboard and I faced no problem at all.
from Python 3.10.2 changelog:
Hi @4sito ,
Thank you for your comment, the problem what we have right now is, we don't have Rosetta emulator installed on Mac M1 hence we will not be able to run python3-intel64 :(
@rasoolmohammedy, sorry but Rosetta should automatically install anytime you try to run an x86 application, I had my M1 Mac for more than a year now, but IIRC there shouldn't be any problem installing Rosetta, as it is an automatic process, other than that unfortuntely I don't know how to help you furthermore
Hi @4sito,
Thank you for your comment. In our case, it is mandatory to run our automation suite without Rosetta. that is our precondition. With rosetta this module works absolutely fine till date.
@rasoolmohammedy oh ok, didn't knew that, unfortunately I can't help you if that's the problem
Importing the module fails. error.txt