ModuleNotFoundError: No module named 'pyperclip'

21,229

Solution 1

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

Solution 2

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.

Solution 3

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.

Share:
21,229
user3376220
Author by

user3376220

Updated on August 25, 2021

Comments

  • user3376220
    user3376220 almost 3 years

    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?

  • user3376220
    user3376220 over 6 years
    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.
  • Sayan Sil
    Sayan Sil over 6 years
    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.
  • user3376220
    user3376220 over 6 years
    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.