Ask coding questions

← Back to all posts
ImportError: You must be root to use this library on linux.
Strategist (0)

How would I get past this error?

Answered by DynamicSquid (4629) [earned 5 cycles]
View Answer
DynamicSquid (4629)

You can't use keyboard because you need root access, which is impossible to get on replit. You have to find another way.

Strategist (0)

@DynamicSquid Do you know a solution for Replit? keyboard is the only way I know of detecting keyboard inputs on Python.

DynamicSquid (4629)

@Strategist I'm not that good with Python, but you can use the getchar module.

Strategist (0)

@DynamicSquid Looks like it would do the job. Thank you!