I want to use Python's library pyautoGUI, so I finished installing it at the terminal, but I cannot import it.
import pyautogui
and the command will also display an error message saying "command not found".
I'm looking for the cause, but if anyone knows, please let me know.Thank you for your cooperation.
(Pyobjc-core, pyobjc, and pillow are already installed)
■ My PC
macOS Catalina
MacBook Pro
Version 10.15.4
■Python version you are using
3.8.2
Is the full text of the error -bash:import:command not found
?
In that case, you must first type in python
at the terminal, start the interpreter, and then run import pyautogui
.
Or are you calling the python script directly with commands such as ./hoge.py
?
This may also result in errors that are not recognized as commands for python.
Use the link below to add a shebang, such as #!/usr/bin/env python3
, or run the script as a python argument, such as python./hoge.py
.
Similar answers from other sites
© 2024 OneMinuteCode. All rights reserved.