Skip to main content
 首页 » 编程设计

python之pyperclip 模块引发错误消息

2024年12月31日9zfyouxi

我在 ArchLinux 上使用 Python 3.4.0(没有 X11)作为 Vagrant box 中的访客。运行我的脚本时,我收到此错误消息:

Pyperclip could not find a copy/paste mechanism for your system

根据这个link ,我已经安装了 xsel 和 xclip 包,但是我无法安装 gtk 和 PyQt4 模块,因为我明白了另一个错误信息:

Could not find a version that satisfies the requirement PyQt4 (from versions: )

根据这个post ,我应该安装 python3-pyqt4 包,但是 pacman 显示的包更接近 python-pyqt5 并且它需要安装许多包,包括 X11 的包。这是必要的吗?我希望尽可能保留我的发行版灯。

有什么解决办法吗?提前致谢。

请您参考如下方法:

这个方法帮我解决了。

pip 安装 QtPy

你也可以引用这个线程以获得更多帮助 https://pyperclip.readthedocs.io/en/latest/introduction.html#not-implemented-error