Search code examples
pythonkeyboardpyautogui

Import error in python as a not Root user


I have tried to use pyautogui and keyboard library in python but it shows error enter image description here


Solution

  • You should use sudo python3 spam.py instead of python3 spam.py.

    You can directly install the library using pip3 install PyAutoGUI and pip3 install keyboard.