5

Similar issues like this have been posted on StackOverflow but I did not find adequate answers to resolve this issue.

I'm running Python 3.6.3 on a Windows 7 machine. From IDLE I type the following import stmt and get the subsequent error:

>>> import pyperclip
Traceback (most recent call last):
  File "<pyshell#5>", line 1, in <module>
    import pyperclip
ModuleNotFoundError: No module named 'pyperclip'

I tried hitting Win-R (to pup up the RUN window) and typed the following:

pip3 install pyperclip
pip install pyperclip

But it gives me an error saying "Could not fetch the URL: https://pypi.python.org/simple/pyperclip/ Could not find a version that satisfies the requirement pyperclip... No Matching distribution found"

If I visit the URL mentioned (https://pypi.python.org/simple/pyperclip/) I see a bunch of pyperclip ZIP files all dif versions. But if I select a version I'm not sure where to place them/extract them or if extracting them is even the right thing to do.

Any advice?

jwodder
  • 54,758
  • 12
  • 108
  • 124
user3376220
  • 61
  • 1
  • 1
  • 4
  • 1
    "Could not fetch the URL: https://pypi.python.org/simple/pyperclip/" means that pip couldn't even load the given URL to see what was listed there. Is there anything between your computer and PyPI that might be interferring with your internet connection (proxy, router, firewall, etc.)? – jwodder Dec 06 '17 at 23:22
  • I'm doing this from work and they do block certain websites. Maybe that can be the interference? However, I am able to copy/paste that URL in my browser and visit the site without any restrictions from my company firewall. So I'm not sure if it's still a firewall/permission issue or something else. – user3376220 Dec 07 '17 at 15:27

8 Answers8

4

There is a problem with the current version of the pyperclip I checked the git repo and opened a pull request for the issue. It currently doesn't support use for python3.7

Greg Witt
  • 61
  • 5
3

You must navigate to your default install location for 3.6. For IDLE 32 bits it's:

C:\Users\<username>\AppData\Local\Programs\Python\Python36-32\Scripts\

for IDLE 64 bits use:

C:\Users\<username>\AppData\Local\Programs\Python\Python36\Scripts\

If you navigate to that directory in the command prompt (use cd command), then the command

pip install pyperclip

should work.

Paul Roub
  • 36,322
  • 27
  • 84
  • 93
Oscar Albert
  • 803
  • 8
  • 13
2

Open cmd and type pip install pyperclip with no double quote.

Enter to run for installation.

If you install successfully, you can import in IDLE.

A DUBEY
  • 806
  • 6
  • 20
1

i had this problem too! and i solved running: python -m pip install pyperclip

note: replace for python that is being used, for example, if you are trying running in python 3.10: python3.10 -m pip install pyperclip

this problem may is because you may more than one python environment which one of then have no pyperclip installed

mitaharumi
  • 46
  • 3
0

For manual Installation,

I went to the link you provided in your question.

Since all of them are pyperclip 1.5, I wouldn't mind downloading any one of them.

However, the person who designed the site must want you to click on the topmost link, instead of scrolling all the way down.

So I downloaded the 1.5.11 version, which was on the top.

And on downloading (I am using my phone) I quickly extracted the zip and saw a nice setup.py file there.

Btw, I wouldn't worry where to unzip or run the setup.py file.

pyperclip unzipped

Go ahead and run the setup.py and let it take its time.

Once done, still not working in IDLE? I suggest use CMD(windows) or Terminal(Linux) and check if it is working there, and then come back to me.

Edit: On having problems installing the setup.py, open CMD as administrator by right clicking and selecting it from the start menu.

Navigate to the directory where setup.py is located and run it inside the CMD, by typing 'setup.py' and press Enter.

Sayan Sil
  • 5,799
  • 3
  • 17
  • 32
  • Thanks Sayan. I downloaded pyperclip1.5.11 and ran the setup.py. I'm running windows so a black command window appeared for a few seconds, saw nothing written or come across it, and then it just closed itself. It does not seem to have worked though. If I open IDLE and try to import pyperclip i get the same ModuleNotFoundError. If I try running my program from the CMD window I also get the same error. When I run setup.py should it create some pyperclip folder in my Python dir? When i search for "pyperclip" i dont see any such folder or files in my python dir. – user3376220 Dec 07 '17 at 15:19
  • The setup.py is designed to work from the command line. Open the terminal in this window where setup.py is located (using admin privileges just in case) or just go to this directory via terminal and then type "setup.py" and enter. – Sayan Sil Dec 07 '17 at 17:30
  • 1
    Thanks Sayan! It works now. Just to clarify and detail what I did (if it helps others): 1) downloaded the zip file and extracted the folder contents to a location on C drive 2) Click the "Start" button and type "cmd." Right-click "Cmd," select "Run as Administrator" 3) changed directory to where the setup.py file is located in the folder I just extracted 4) typed "setup.py install" 5)Now I'm able to import the module into my code. – user3376220 Dec 07 '17 at 20:24
0

Thanks, it worked for me too. See below details as written above:

Thanks Sayan! It works now. Just to clarify and detail what I did (if it helps others):

  1. downloaded the zip file and extracted the folder contents to a location on C drive
  2. Click the "Start" button and type "cmd." Right-click "Cmd," select "Run as Administrator" 3)
  3. changed directory to where the setup.py file is located in the folder I just extracted
  4. typed "setup.py install"
  5. Now I'm able to import the module into my code
Ignacio Ara
  • 2,476
  • 2
  • 26
  • 37
Ayaz
  • 9
  • 1
0

Go to windows and search for your IDE (e.g. VsCode)

enter image description here

Then Go to the folder of your IDE and go to the properties of file that end .exe go to properties -> compatibility -> [✔️] Run this program as an administrator (apply and then Ok)

enter image description here enter image description here

0

Manual installation of pyperclip is possible. Just download the version you want from https://pypi.org/simple/pyperclip/, extract it and run setup.py install (or python setup.py install) in the extracted folder.

Jahus
  • 63
  • 1
  • 10