AttributeError: module 'keyboard._darwinkeyboard' has no attribute 'type_unicode'
See original GitHub issueHello, I am testing your “write.py” example on OSX Sierra 10.12.6. I tested this using the native python 2.7.10 and brew install of python 3 at 3.6.2. Used pip to install keyboard once in both python environments. Both had identical errors listed below.
The program actually works, but then crashes with the following error:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/keyboard/__init__.py", line 570, in write
scan_code, modifiers = _os_keyboard.map_char(letter)
File "/usr/local/lib/python3.6/site-packages/keyboard/_darwinkeyboard.py", line 390, in map_char
return key_controller.map_char(character)
File "/usr/local/lib/python3.6/site-packages/keyboard/_darwinkeyboard.py", line 305, in map_char
return self.key_map.character_to_vk(character)
File "/usr/local/lib/python3.6/site-packages/keyboard/_darwinkeyboard.py", line 153, in character_to_vk
raise ValueError("Unrecognized character: {}".format(character))
ValueError: Unrecognized character: enter
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "write.py", line 14, in <module>
keyboard.write(line)
File "/usr/local/lib/python3.6/site-packages/keyboard/__init__.py", line 584, in write
_os_keyboard.type_unicode(letter)
AttributeError: module 'keyboard._darwinkeyboard' has no attribute 'type_unicode'
I cannot tell if this is a configuration, dependency or other problem. But it is an issue with one of the standard examples.
Thanks for your Open Source contributions.
Regards, -FT
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
python - (AttributeError) installation problem with keyboard
I am having a issue when I try to use the keyboard module. My code is: import ...
Read more >keyboard.is_pressed attribute error - Python Forum
Hello all. I'm totally new to python and try to walk before I can crawl. The intention of the below code is to...
Read more >Handling the keyboard — pynput 1.7.6 documentation
from pynput import keyboard def on_press(key): try: print('alphanumeric key {0} pressed'.format( key.char)) except AttributeError: print('special key {0} ...
Read more >Can't use the new keyboard component (from Psychtoolbox)
I created a basic Stroop experiment to check if everything was working properly and got this error message: WARNING Import Error: No module...
Read more >keyboard - PyPI
Works with Windows and Linux (requires sudo), with experimental OS X support (thanks @glitchassassin!). Pure Python, no C modules to be compiled.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @antontarasenko
I never had a Mac, so imagine my surprise when I learned that the “backspace” key in a Mac is named “delete”, and the “delete” is “forward delete”. The library seems to be going by that, so the “backspace” key was missing.
I changed the names around to the more cross-platform way, which I understand may break some things, but is a choice that must be named. Any opinion on this, @glitchassassin ?
I also added a bunch more key codes. Again, I can’t test any of this, so @antontarasenko , could you test the latest master version, ccfdc1c?
@boppreh
Hi! Another happy user of your package has this error.
I’m doing
keyboard.add_abbreviation('email', 'my.long.email@example.com')
like this:Then I run this file, type
email<space>
in a terminal or text editor, and the script returns:I’m using the fixed version as in https://github.com/boppreh/keyboard/commit/f740496780ea7f1e3ebdf422db99a328b5bbea34
Details:
pip3 install pyobjc-core; pip3 install pyobjc-framework-Quartz
notpip3 install quartz
(the latter gives the requirements.txt error)