关闭。这个问题需要debugging details .它目前不接受答案。
想改进这个问题?将问题更新为 on-topic对于堆栈溢出。
去年关闭。
Improve this question
不工作
import pygame,sys,random,time,keyboard
错误Traceback (most recent call last):
ImportError: No module named keyboard
[dir: /Users/sebastianegeland/Desktop/kode stuff]
[path: /Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Pyt
最佳答案
看起来您根本没有安装“键盘”库。
在您的终端中只需执行
pip install keyboard
它应该工作。
为清楚起见,我也会每行进行一次导入,如下所示:
import pygame
import sys
import etc
这是导入多个模块的首选方式。
关于python-3.x - 导入错误 : No module named keyboard,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57761896/