Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python 3.5 Pyperclip module import failure

Just started learning Python. And i'm having trouble using the Pyperclip module.

When I tried to use the pip install pyperclip in the command line, it shows up this error:

pip install pyperclip
          ^
SyntaxError: invalid syntax

I am running Python 3.5 (32 bit) on a Windows 7 desktop.

like image 939
Max Avatar asked Nov 02 '15 00:11

Max


People also ask

Does Pyperclip work with Python 3?

Project description. Pyperclip is a cross-platform Python module for copy and paste clipboard functions. It works with Python 2 and 3.

How do you use Pyperclip PY?

Installing pyperclip:To copy text to the clipboard, pass a string to pyperclip. copy() . To paste the text from the clipboard, call pyperclip. paste() and the text will be returned as a string value.


2 Answers

open command prompt type: pip install pyperclip

if this doesn't work then do this use cd Python35/Scripts to get to the scripts folder This is the folder where pip is located.

Now type: pip install pyperclip

This will download and install pyperclip

now type: pip freeze

And pyperclip should be listed

If you want to test in python shell remember to close the shell(if open) and open new one because it needs to load the new package.

type in python shell: import pyperclip

it should accept it and now you can pyperclip.copy() and pyperclip.paste()

Good luck!

like image 59
Alexander Køpke Avatar answered Sep 20 '22 17:09

Alexander Køpke


sudo pip3 install pyperclip

did the trick for me

like image 27
droschky Avatar answered Sep 18 '22 17:09

droschky