That also works, although this will get messy if you ever install other versions of python. There ie a reason the defaults are the way they are. Answer from MegaIng on discuss.python.org
🌐
PyPI
pypi.org › project › pyperclip
pyperclip · PyPI
Pyperclip is a cross-platform Python module for copy and paste clipboard functions.
      » pip install pyperclip
    
Published   Sep 26, 2025
Version   1.11.0
🌐
Readthedocs
pyperclip.readthedocs.io › en › latest
Welcome to Pyperclip’s documentation! — Pyperclip 1.5 documentation
Pyperclip provides a cross-platform Python module for copying and pasting text to the clipboard.
Discussions

Pyperclip how to install
How can I install it? I tried many times … thanks Giorgio More on discuss.python.org
🌐 discuss.python.org
8
0
October 21, 2024
How do I install pyperclip on python? I have version 3.11.4 and I'm using Windows 11 - Stack Overflow
so I am making my way through the "Automate the Boring Stuff with Python" course on Udemy. I'm on lesson 8 right now. In lesson 8, the instructor just very quickly downloads pyperclip wit... More on stackoverflow.com
🌐 stackoverflow.com
How to use Python's Pyperclip to paste text on a separate program? - Stack Overflow
I am trying to code a very basic code where I copy some text from one program and then paste it in a different program. I'm not sure how to do this as Pyperclip only seems to paste the text on the More on stackoverflow.com
🌐 stackoverflow.com
Why is pyperclip useful? It´s just copying and pasting the string...
I once used it to make a calculator where I just had to copy an equation to the clipboard, and the calculator would solve it and write the answer to the clipboard, ready for the user to instantly paste the answer somewhere else without ever having to manually type anything in or out. My point is... get creative! More on reddit.com
🌐 r/learnpython
6
April 11, 2020
🌐
Pybites
pybit.es › articles › pyperclip
Copy and Paste with Pyperclip – Pybites
January 6, 2017 - Pyperclip is a module you can import that allows you to copy and paste to and from the clipboard on your computer. It does this through the use of two functions: copy() and paste()…
🌐
Anaconda.org
anaconda.org › conda-forge › pyperclip
pyperclip - conda-forge
Organization created on Apr 11, 2015 · A community-led collection of recipes, build infrastructure, and distributions for the conda package manager
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › python › pyperclip-module-in-python
Pyperclip module in Python - GeeksforGeeks
February 27, 2020 - Pyperclip is a cross-platform Python module for copy and paste clipboard functions. It works with both Python 2 and 3. This module was created to enable cross-platform copy-pasting in Python which was earlier absent.
🌐
GitHub
github.com › alvistack › asweigart-pyperclip
GitHub - alvistack/asweigart-pyperclip: Python module for cross-platform clipboard functions.
Pyperclip is a cross-platform Python module for copy and paste clipboard functions.
Author   alvistack
🌐
Invent with Python
inventwithpython.com › pyperclip.py
Pyperclip
""" Pyperclip A cross-platform clipboard module for Python, with copy & paste functions for plain text.
🌐
Arch Linux
archlinux.org › packages › extra › any › python-pyperclip
Arch Linux - python-pyperclip 1.11.0-2 (any)
View the file list for python-pyperclip · View the soname list for python-pyperclip · Copyright © 2002-2026 Judd Vinet, Aaron Griffin and Levente Polyák. The Arch Linux name and logo are recognized trademarks. Some rights reserved.
🌐
Note.nkmk.me
note.nkmk.me › home › python
Copy and Paste Text to the Clipboard with pyperclip in Python | note.nkmk.me
January 30, 2024 - In Python, pyperclip allows you to copy text to the clipboard, paste text from the clipboard, and even monitor the clipboard for updates. pyperclip · PyPI asweigart/pyperclip: Python module for cross ...
🌐
Tutorialspoint
tutorialspoint.com › python › python_pyperclip_module.htm
Python - pyperclip Module
In Python, the pyperclip module is used for the various operation related to clipboard such as cut, copy, and paste. It makes it ideal for such tasks where you need to transfer data between applications, scripts, or several processes that involve an
🌐
GeeksforGeeks
geeksforgeeks.org › installation guide › how-to-install-pyperclip-in-python-on-linux
How to Install pyperclip in Python on Linux? - GeeksforGeeks
July 23, 2025 - Pyperclip is a cross-platform Python module for copy and pasting, or we can say that it provides clipboard functionality. It was created to allow cross-platform copy-pasting in Python which was before missing. It is available for Python 2 and 3.
🌐
GeeksforGeeks
geeksforgeeks.org › installation guide › how-to-install-pyperclip-in-python-on-macos
How to Install pyperclip in Python on MacOS? - GeeksforGeeks
July 23, 2025 - Pyperclip is a cross-platform Python module for copy and paste clipboard functions. It works with both Python 2 and 3. This module was created to enable cross-platform copy-pasting in Python which was earlier absent.
Top answer
1 of 5
17
sudo apt-get install xclip

Run this command on your terminal, then run the Python test.

2 of 5
16

The clipboard is part of your GUI. But you don't have a GUI. So there is no clipboard to copy and paste with. There is no clipboard for pyperclip to access, so it doesn't matter how you try to access it, you're going to fail.

You can test very easily by running this at the shell:

xclip

If it says something like Error: No display: (null), then that's your problem.


If you think you should have a GUI, because you've set things up to, e.g., tunnel X11 through ssh to an X server on your desktop machine, but you're still getting an error from xclip, then the problem is that you've set things up wrong. The simplest thing to check is:

echo $DISPLAY

Is that empty? Then your session doesn't know anything about your X11 tunnel. Getting tunneling set up properly is really an issue for a site like Super User or Unix, not Stack Overflow—and, once you get that fixed, pyperclip, and your script, should just start working.


As for what you can do about it… well, it depends on why you were trying to use pyperclip in the first place. On a headless system, there's nowhere to copy data from, and nowhere to paste it to, so it wouldn't be particularly useful.

If you're trying to, e.g., share data between two different Python scripts on the same machine, then there are simpler ways to do that than passing it through a clipboard—just use a file, a pipe, a socket, etc.—that don't even require a third-party library with complicated setup.

🌐
Reddit
reddit.com › r/python › pip and pyperclip: installing modules. following automate the boring stuff with python.
r/Python on Reddit: PIP and Pyperclip: Installing modules. Following automate the boring stuff with python.
January 3, 2020 -

Hi guys,

I’m following the Automate the boring things tutorial on Udemy along with the free online text. I have installed python and am able to make simple programs but can’t use modules for some reason. Specifically in the pyperclip portion of the tutorial early on. When I put “import pyperclip” I get:

Traceback (most recent call last): File “<pyshell#0>”, line 1, in <module> Import pyperclip ModuleNotFoundError: No module named ‘pyperclip’

I am a total noob and don’t know what I’m doing wrong and tried referring to the free automate the boring stuff section of install modules. But I don’t understand what I need to do in the command window to get there. I also go into my program files and don’t find that folder directory mentioned there.