【发布时间】:2022-01-17 20:14:32
【问题描述】:
简单来说就是这个故事。彩票游戏。导入键盘。 Linux 根目录。模块未找到错误。为什么导入的“键盘”会出现 ModuleNotFoundError?
这是导入的代码 sn-p 以及我使用它的目的。
import keyboard
if userNums == winningNums:
print(“\nCongratulations! You won the jackpot!”)
print(“Press M to return to the menu.”)
if keyboard.is_pressed(“m”):
printMenu()
else:
print(“Please press M to return to the menu!”)
【问题讨论】:
-
你跑
pip install keyboard了吗? -
是的。我跑了 pip install keyboard,它应该是 0.13.5 版本。
-
是否有可能安装了多个 Python 版本?
-
没有。仅 3.9.2 版。
标签: python visual-studio-code keyboard