In order to work equally well on all operating systems Pyperclip uses various copy/paste mechanisms.
But sometimes users get an error similar to this
pyperclip.PyperclipException: Pyperclip could not find a copy/paste mechanism for your system. For more information, please visit https://pyperclip.readthedocs.io/en/latest/index.html#not-implemented-error
Currently, this error should only appear on Linux (not Windows or MacOS). The reason is on Windows no additional modules are needed, on MacOS Pyperclip makes use of the pbcopy and pbpaste commands which come with the os and on Linux, Pyperclip makes use of the xclip or xsel commands, which should come with the os but on some distros they don't.
Solving the issue is easy, try running the below command in the Terminal.
sudo apt-get install xclip
Try running the module again, if it doesn't clip try installing xsel using the below command.
sudo apt-get install xsel
If it still doesn't work you might need some Python modules like gtk or PyQt4. Try installing those using the below command.
To install gtk:
pip3 install gtk
To install PyQt4:
pip3 install PyQt4
Now, the Pyperclip module should work perfectly without any issues. If it still doesn't make sure that you have followed the previous instructions properly.
Comments