Unable to import pyperclip module

752 Views Asked by At

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

1

There are 1 best solutions below

2
CodeMonkey On

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.