Skip to main content
 首页 » 编程设计

python之导致操作系统错误的 Pyperclip 复制

2024年10月24日14www_RR

我正在尝试使用 https://automatetheboringstuff.com 学习 python .

在 IDLE(Python 3.5 - 64 位)、windows 8.1 上,pyperclip.copy('test') 给出以下错误消息

pyperclip.copy('test') Traceback (most recent call last): File "", line 1, in pyperclip.copy('test') File "C:\Python\lib\site-packages\pyperclip__init__.py", line 53, in _copyWindows ctypes.cdll.msvcrt.wcscpy(ctypes.c_wchar_p(pchData), text) OSError: exception: access violation writing 0x0000000000000000

感谢任何帮助!

请您参考如下方法:

问题似乎是某些 Windows PC 上的 64 位版本的 Python。

我在使用与您相同版本的 Python 3.5(64 位 - Windows x86-64 可执行安装程序)时遇到了这个问题。我在 Python 3.4 中没有这个问题,但我使用的是该版本的 32 位版本。我刚刚下载并安装了 32 位版本的 Python 3.5(Windows x86 可执行安装程序),在使用 pyperclip 时它没有给我带来问题。