为什么即使明确安装了pyperclip,也无法“找到”?

时间:2019-09-08 17:03:35

标签: python pyperclip

我正在为班级做一个基本的编码项目。这是“自动完成钻孔”中的密码柜。

我已经正确编码了所有内容,没有错误地进行编译,并且制作了bat文件,并且位置正确。

这是代码(减去#号前面的破折号)

#! python3

#pw.py This is an insecure Password Locker.

PASSWORDS = {'yahooEmail':'12345', 'googleEmail':'23456','facebook':'34567', 'luggage':'45678'}

import sys, pyperclip
if len(sys.argv) < 2:
    print('Usage: py pw.py [account] - copy account password')
sys.exit()

account = sys.argv[1]   # first command line arg is the account name

if account in PASSWORDS:
    pyperclip.copy(PASSWORDS[acount])
    print('Password for ' + account + ' copied to clipboard.')
else:
    print('There is no account named ' + account +'.')

因此,当然应该允许我键入键以查看值,并根据需要复制/粘贴新值。

但是当我运行它时,我得到了:

Traceback (most recent call last):

  File "C:\Users\shawn\Desktop\Python homework\pw.py", line 6, in <module>

    import sys, pyperclip

ModuleNotFoundError: No module named 'pyperclip'

0 个答案:

没有答案