简体   繁体   中英

Pyautogui cannot move the mouse but can read position

I am using Visual Studio code to run python for pyautogui. However I cannot control the pointer by

pyautogui.moveTo(0,0,duration=2)

But when I check to use the module correctly I can read the position of pointer up to date.

I tried to keep all the software up to date and double check for the accessibility, and found its keep working to read the pointer even the accessibility is off. So I am thinking will that be other setting in VScode affect.

Can anyone tell what is wrong with it and how I can solve it?

I have provide right for Visual Studio Code to take control in mac system accessibility...

I also had this error.

To fix that, try running it on 'IDLE'. You can run it on 'IDLE' by right clicking on the python file, then click 'edit with IDLE'.

It will open 'IDLE' with the code you have written on the python file. After that click on 'Run' then click on 'Run module'.

boom! you are done!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM