为什么打开cmd键入 pip install pynput 之后会出现错误??

  • 回答 (1)
  • 关注 (0)
  • 查看 (160)

打开cmd 键入pip install pynput

第三方模块pynput通过cmd 方式安装出现错误,显示:

Traceback (most recent call last):

File "d:\python3\lib\runpy.py", line 193, in _run_module_as_main

"__main__", mod_spec)

File "d:\python3\lib\runpy.py", line 85, in _run_code

exec(code, run_globals)

File "D:\python3\Scripts\pip.exe\__main__.py", line 9, in <module>

TypeError: 'module' object is not callable

在python编译器中打印代码:

import time
from pynput.keyboard import Controller as key_cl
from pynput.mouse import Button, Controller

打印结果:

Traceback (most recent call last):

File "H:\python\11..py", line 2, in <module>

from pynput.keyboard import Controller as key_cl

ModuleNotFoundError: No module named 'pynput'

求大神帮忙解决一下,谢谢了!

用户6639584用户6639584提问于
_逗你玩_

腾讯 · 客户端安全 (已认证)

回答于

可能是pip损坏了,试试

python -m pip install pynput

扫码关注云+社区

领取腾讯云代金券

年度创作总结 领取年终奖励