4

I am having trouble importing Pyperclip in IDLE.
I am running windows 7 (64-bit).
I have Python 3.5.2 Installed on: C:\Python\Python35.
I opened command prompt and initiated the install by typing pip install pyperclip after changing directory to C:\Python\Python35\Scripts. It successfully installed Pyperclip-1.5.27. I then went to IDLE and typed in import pyperclip but the following error is showing up:

Traceback (most recent call last): File "", line 1, in import pyperclip ImportError: No module named 'pyperclip'

I tried to fix this by adding "C:\Python\Python35" to the end of the "Path" variable, in the systems environmental variables.

Ozixic
  • 141
  • 1
  • 2
  • 11
  • Did you run the setup.py file? Read this http://stackoverflow.com/questions/6081317/using-pyclips-and-import-clips-as-a-python-module – Kode.Error404 Jun 30 '16 at 01:50

3 Answers3

10

Try

pip3 install pyperclip

That installs pyperclip in python3.

phd
  • 82,685
  • 13
  • 120
  • 165
Secant Zhang
  • 731
  • 6
  • 7
7

It unpacked pyperclip in the wrong directory. I copied the entire pyperclip folder and put it in C:/python/python35, now it works as it should. Seems like a noob mistake on my part, but it took me a long time to figure this out. I hope this helps someone in the future.

Ozixic
  • 141
  • 1
  • 2
  • 11
1

For those working in a venv, make sure that you have pyperclip installed in the directory that your venv is running in.
Eg. C:\MY_PROJECT\venv\Lib\site-packages should include the pyperclip module. If you don't find it here, have a look at where you installed Python and you'll find it there.
Eg. C:\Users\Username\AppData\Local\Programs\Python\Python39\Lib\site-packages

User1010
  • 789
  • 1
  • 6
  • 19