The purpose of Pyperclip is to provide a cross-platform Python module for copying and pasting text to the clipboard.
To copy text to the clipboard, pass a string to
pyperclip.copy(). To paste the text from the clipboard, call
pyperclip.paste() and the text will be returned as a string value.
>>> import pyperclip >>> pyperclip.copy('Hello world!') >>> pyperclip.paste() 'Hello world!'
Not Implemented Error¶
You may get an error message that says: “Pyperclip could not find a copy/paste mechanism for your system. Please see https://pyperclip.readthedocs.io/en/latest/introduction.html#not-implemented-error for how to fix this.”
In order to work equally well on Windows, Mac, and Linux, Pyperclip uses various mechanisms to do this. Currently, this error should only appear on Linux (not Windows or Mac). You can fix this by installing one of the copy/paste mechanisms:
sudo apt-get install xselto install the xsel utility.
sudo apt-get install xclipto install the xclip utility.
pip install gtkto install the gtk Python module.
pip install PyQt4to install the PyQt4 Python module.