I installed pyautoGUI on my Mac, but I can't import it.

Asked 2 years ago, Updated 2 years ago, 43 views

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

python python3

2022-09-30 19:46

1 Answers

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


2022-09-30 19:46

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.