简体   繁体   中英

pykeyboard not importing from its module

I am having an issue where the package PyKeyboard is unable to be imported from its library pykeyboard . When executing the following: from pykeyboard import PyKeyboard I am subjected to the following error:

  File "relay.py", line 9, in <module>
    from pykeyboard import PyKeyboard
ImportError: cannot import name 'PyKeyboard' from 'pykeyboard' (/home/pi/.local/lib/python3.7/site-packages/pykeyboard/__init__.py)

Uninstalling the package, running from root, or reinstalling Python lead me to no avail at all. I am at a brick wall.

Make sure the dependencies are installed. Considering that you are using PyUserInput 0.1.11 ( as you said )

Depending on your platform, you will need the following python modules for PyUserInput to function:

  • Linux - Xlib
  • Mac - Quartz, AppKit
  • Windows - pywin32, pyHook

If you are using Windows, for installing pywin32 run

pip install pywin32

And for pyHook make sure to install your system's version. Here you'll find both 64 and 32. Note that for whl files one may need to install wheel, as

pip install wheel

And then

wheel install file_name.whl

When the dependencies are installed, install the package with

pip install PyUserInput

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM