[英]pykeyboard not importing from its module
I am having an issue where the package PyKeyboard
is unable to be imported from its library pykeyboard
.我遇到无法从其库pykeyboard
导入 package PyKeyboard
的问题。 When executing the following: from pykeyboard import PyKeyboard
I am subjected to the following error:执行以下操作时: from pykeyboard import PyKeyboard
我遇到以下错误:
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.卸载 package,从 root 运行,或重新安装 Python 导致我无济于事。 I am at a brick wall.我在砖墙上。
Make sure the dependencies are installed.确保已安装依赖项。 Considering that you are using PyUserInput 0.1.11 ( as you said )考虑到您使用的是PyUserInput 0.1.11 ( 如您所说)
Depending on your platform, you will need the following python modules for PyUserInput to function:根据您的平台,您将需要以下 python 模块用于 PyUserInput 到 function:
- Linux - Xlib Linux-Xlib
- Mac - Quartz, AppKit Mac - 石英,AppKit
- Windows - pywin32, pyHook Windows - pywin32,pyHook
If you are using Windows, for installing pywin32
run如果您使用 Windows,安装pywin32
运行
pip install pywin32
And for pyHook
make sure to install your system's version.对于pyHook
,请确保安装您系统的版本。 Here you'll find both 64 and 32. Note that for whl files one may need to install wheel, as在这里你会找到 64 和 32。请注意,对于whl 文件,可能需要安装 wheel,如
pip install wheel
And then接着
wheel install file_name.whl
When the dependencies are installed, install the package with安装依赖项后,安装 package
pip install PyUserInput
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.