Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pyperclip stopped working
#1
I have been using pyperclip for some time, using Python 3.6.9 on Ubuntu 18.04 LTS. I have now moved to Python 3.12.3 on Ubuntu 24.04 LTS, and pyperclip has stopped working.
This works in the interpreter -
>>>import pyperclip
>>>pyperclip.copy('pyperclip test')
>>>pyperclip.paste()
>>>'pyperclip test'
but if I do Ctrl-V after the copy command, I get what I last put on the clipboard, not ‘pyperclip test’. And when I use it in real code, the clipboard (as examined by Ctrl-V) is empty.

I have checked that xsel, xclip and qtpy are installed on my system.
Anyone any ideas?
"Life is hazardous. Worse, it is inevitably fatal."
Reply
#2
try upgrading:
pip install --upgrade pyperclip
looking at the package docs, it was last upgraded in 2024
Reply
#3
(Apr-02-2025, 10:06 PM)Larz60+ Wrote: try upgrading:
pip install --upgrade pyperclip
looking at the package docs, it was last upgraded in 2024
It is already the latest version - I upgraded it when I moved the system last week.
"Life is hazardous. Worse, it is inevitably fatal."
Reply
#4
then perhaps you should send an email to one of the maintainers
email addresses located here: https://pypi.org/project/paperclip/
Reply
#5
(Apr-04-2025, 04:26 AM)Larz60+ Wrote: then perhaps you should send an email to one of the maintainers
email addresses located here: https://pypi.org/project/paperclip/

@Larz60+ this is different package, django-realted

this is pyperclip
And anyway it's better to post issue on their Github repo, rather than sending an e-mail
That is, if they indeed think there is bug/incompatibility with python 3.13
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#6
Do pip --version to see what version it install to.
If wrong use python -m pip install pyperclip

Now should use uv🚀,it makes all easier(will download Python version if not on OS) and faster.
Here a 10-sec test and pyperclip work for python 3.13.1
tom@tom-VirtualBox:~/test_env$ uv venv --python 3.13.1
Using CPython 3.13.1
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
tom@tom-VirtualBox:~/test_env$ source .venv/bin/activate
(test_env) tom@tom-VirtualBox:~/test_env$ uv pip install pyperclip
Resolved 1 package in 8.32s
      Built pyperclip==1.9.0
Prepared 1 package in 1.04s
Installed 1 package in 1ms
 + pyperclip==1.9.0

(test_env) tom@tom-VirtualBox:~/test_env$ python
Python 3.13.1 (main, Jan 14 2025, 22:47:38) [Clang 19.1.6 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyperclip
>>> exit
Reply
#7
Thank you for your reply, but I didn't understand very much of it.
The Python version I am using is 3.12.3 (which is what came with Ubuntu 24.04)
When I use pip I get an error message

"This environment is externally managed
╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to
install."
which is what I did when I installed pyperclip.

I do not understand what your code snippet is doing - downloading pyperclip (& compiling it?). Nor do I properly understand what a virtual enviromnent is, and why it is useful/necessary to use one. Nor do I see evidence that whatever you have done has fixed my problem.

Thank you hor your help, and sorry to be so negative about it.
"Life is hazardous. Worse, it is inevitably fatal."
Reply
#8
OAP Wrote:When I use pip I get an error message

"This environment is externally managed
╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to
Do sudo apt install python3-pip,this should install pip for Python 3.12.3.
Then try pip install pyperclip

Also look at uv is the new approach to a make universal tool for Python.
uv Wrote:A single tool to replace pip, pip-tools, pipx, poetry, pyenv, twine, virtualenv, and more.
10-100x faster than pip
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python-Kasa stopped working liderbug 1 407 Jan-27-2025, 02:47 PM
Last Post: liderbug
  Spyder stopped working in Windows 10 gammaray 3 4,240 Apr-19-2021, 05:33 PM
Last Post: jefsummers
  Using Pyperclip in Python 3 Does Not Paste Data in Desired Format aspire27 0 2,821 Sep-06-2019, 11:35 PM
Last Post: aspire27
  python has stopped working sally 1 6,780 Nov-22-2018, 10:19 PM
Last Post: metulburr
  Installing pyperclip module Truman 5 20,232 Apr-29-2018, 03:29 PM
Last Post: snippsat
  mkdtemp spontaneously stopped working reliably last night saporta98 1 3,408 Apr-16-2018, 05:12 PM
Last Post: nilamo
  Stopped process is still running pawlaczkaj 9 6,217 Apr-08-2018, 10:22 AM
Last Post: Gribouillis
  Downloading and using pyperclip PMPythonlearner 2 6,009 Dec-31-2017, 04:37 PM
Last Post: PMPythonlearner
  urlparse to urllib.parse - the script stopped working apollo 5 7,777 Oct-26-2017, 06:57 AM
Last Post: apollo
  Logging module stopped working! llanitedave 1 11,035 Oct-18-2017, 06:45 AM
Last Post: llanitedave

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020