GithubHelp home page GithubHelp logo

Comments (10)

bleuetnoir avatar bleuetnoir commented on July 20, 2024 3

I have tested it at home in a Debian VM, I had to disable cursor integration (Virtualbox) and install a few libraries but the results are the same as what I had in Windows (but I have not tested "elastic" and "back up" tweens).

The simplest test case is:

import pyautogui
from pyautogui import tweens

pyautogui.moveTo(500, 500, duration=2, tween=pyautogui.tweens.easeInOutQuad)

This doesn't work as is (no move at all).

from pyautogui.

asweigart avatar asweigart commented on July 20, 2024 2

The update to the documentation in 166b828 corrects this. The tweens module no longer exists, instead you just specify the function directly: pyautogui.easeInOutQuad instead of pyautogui.tweens.easeInOutQuad.

from pyautogui.

adamkdean avatar adamkdean commented on July 20, 2024 1

I am also getting this issue, and it's 2016 now.

Traceback (most recent call last):
File "c:\Users\Adam\Projects\Test\test.py", line 8, in
pyautogui.moveTo(500, 500, duration=2, tween=pyautogui.tweens.easeInOutQuad)
AttributeError: module 'pyautogui' has no attribute 'tweens'

Edit, looks like I had to import pyautogui.tweens like so:

import pyautogui
import pyautogui.tweens

# use tweening/easing function to move mouse over 2 seconds.
pyautogui.moveTo(500, 500, 2, pyautogui.tweens.easeInOutQuad)

from pyautogui.

asweigart avatar asweigart commented on July 20, 2024

Thanks, I'll take a look at it today.

from pyautogui.

asweigart avatar asweigart commented on July 20, 2024

Ah, I think I know what the problem is. Is PyAutoGUI updated to the latest version? 0.9.20

In a previous version, PyAutoGUI was set up so that it only expected ranges between 0.0 and 1.0 from the tweening functions. However, the "elastic" and "back up" tweens overshoot the target (for cosmetic effect), and so I rewrote the PyAutoGUI code.

Reopen if this bug is present in 0.9.20. Also, what tween were you using?

from pyautogui.

bleuetnoir avatar bleuetnoir commented on July 20, 2024

Yes, the issue was with 0.9.20 installed with pip, sorry I forgot to add this information in the issue.
It was not even working with linear tween...

from pyautogui.

asweigart avatar asweigart commented on July 20, 2024

Do you have some code snippets that can reproduce the problem? What exactly is happening? Is the mouse not moving at all? Or is it moving instantly?

from pyautogui.

skorokithakis avatar skorokithakis commented on July 20, 2024

I'm having a similar issue on Ubuntu, pyautogui.moveTo(500, 500, duration=1, tween=pyautogui.easeInOutQuad) just makes the pointer sit there and jump to the target after a second, without any tweening or animation at all. I'm running in a virtualenv.

from pyautogui.

neatville avatar neatville commented on July 20, 2024

I use Ubuntu also, and I get an error when I try it (whether it's python2 or 3).

 pyautogui.moveTo(100, 100, 2, pyautogui.tweens.easeInQuad)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'tweens'

from pyautogui.

kimborgen avatar kimborgen commented on July 20, 2024

@asweigart Why is this still not fixed in the readme? 🤔

from pyautogui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.