Home > Software engineering >  How to install keyboard in python virtual environement | ImportError: You must be root to use this l
How to install keyboard in python virtual environement | ImportError: You must be root to use this l

Time:11-20

I did the following for keyboard interaction;

pip install keyboard

But when I execute, I get the following error;

ImportError: You must be root to use this library on linux.

My OS is Linux, and I work in python virtual environment and use Spyder. In addition to pip, I also tried conda install, but none of them helped. Some posts suggested to use sudo, so I tried sudo pip install keyboard in my python environment. But no use!!

I also tried my python script executable using chmod x, but no success. Thanks for any input.

CodePudding user response:

You're not supposed to run pip as root - you're supposed to run your program as root!

CodePudding user response:

did you tryed "sudo su"? or is the problem that youre trying to intsall it for python3? "sudo pip3 install keyboard"

  • Related