1

I used pip3 install pyperclip and it successfully installed pyperclip:

user@user:~$ pip3 install pyperclip
Collecting pyperclip
Installing collected packages: pyperclip
Successfully installed pyperclip-1.6.2

When I tried to import pyperclip in python3 it showed:

user@user:~$ python3 Python 3.7.0 (default, Jul 11 2018, 02:16:41) 
[GCC 7.3.0] on linux Type "help", "copyright", "credits" or "license"
for more information.
>>> import pyperclip Traceback (most recent call last):   File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named
'pyperclip'
>>>

I also checked in pip3 list and saw pyperclip listed there. I'm on Ubuntu 18.04

Al Sweigart
  • 11,566
  • 10
  • 64
  • 92
vApor
  • 23
  • 1
  • 5

1 Answers1

0

Try closing and reopening in a new shell if you did not already. Do you have more than one python installation? It's possible it installed for a version separate than the one you're running the import on. If that's the case, then be sure your PATH variable lists ONLY the Python version you're interested in from the command line.

CodeMonkey
  • 1,795
  • 3
  • 16
  • 46
  • I found out the problem, the module pyperclip was installed on python3.6 directory and "python3" cmd was opening python3.7. It seems pip3 by default downloads the module in python3.6 dir. Is there any way to change the location of default pip3 download directory? – vApor Jul 22 '18 at 02:29
  • I updated the answer, but you'll need to update your PATH variable to include only the one version you care about. – CodeMonkey Jul 22 '18 at 13:08