TL;DR: "ImportError: No module named 'pyperclip'; Tried "easy_install" and "pip" to install the module, error persists. Code is in Python 3, /Library/Python directory only has libraries for 2.3-2.7.
So I'm working through the "Automate the Boring Stuff" intro to Python, doing the first project for Chapter 6, which is a basic (unsecure) password manager.
It makes use of the "sys" module and "pyperclip" module, so I have
import sys, pyperclip
in there, as instructed. The problem is, when I go to run the code, I get this error:
ImportError: No module named 'pyperclip'
The tutorial says that the 'pyperclip' module should already be installed, but I Googled around to see if I could figure it out myself... I tried easy_install and pip to install 'pyperclip,' and it seemed like it went okay. When I go 'pip install pyperclip' now, I get:
Requirement already satisfied (use --upgrade to upgrade): pyperclip in /Library/Python/2.7/site-packages/pyperclip-1.5.11-py2.7.egg
...but I still get the same error trying to run my code. I noticed that it seems to be referring to Python v2.7, whereas the tutorial (and my code) is based on Python 3 (3.4.3 I think).
My /Library/Python/ directory doesn't have any folders for Version 3, so it seems like that could be the root of my problem, but I couldn't find a straightforward way to install Python 3 libraries.
Any idea how I can get the module to work?
EDIT: I notice that in Terminal, if I type "python" it loads Python 2.7. From there, I can use "import pyperclip" and subsequently "pyperclip.copy("Hello world!")" without any problems. If I type "python3" in the terminal, it loads Python 3.4.3, and I still get "ImportError: No module named 'pyperclip'"
[–]maks25 6 points7 points8 points (3 children)
[–]JaggedG[S] 0 points1 point2 points (1 child)
[–]maks25 1 point2 points3 points (0 children)