Jump to content
Sign in to follow this  
Guest

No module named 'autoit'

Recommended Posts

Guest

Hello,

I hope that im in the right Section here, i was trying out the "autoit" package but i have the problem that it just doesn't properly import i guess. I keep getting the "No module named 'autoit'" error, tried using pip install and PyCharm, also tried installing Python64 & Python32 bit (With PathLength ticked) and honestly, im kinda out of idea's on what to do.

Traceback (most recent call last):  
  File "...\image_detection.py", line 5, in <module>
    import autoit
ModuleNotFoundError: No module named 'autoit'

Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites
Guest
9 minutes ago, JLogan3o13 said:

@Krum3L am I correct that you're trying to run this from python, based on the traceback?

Yes, since a friend im doing a project with is doing the same and it is working for him, it is very wierd.

Share this post


Link to post
Share on other sites
pip install -U pyautoit

make sure you have properly installed the module, else you can't import.


My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
Guest
3 minutes ago, Earthshine said:

pip install -U pyautoit

make sure you have properly installed the module, else you can't import.

Thats one of the first few things i tried, its not even showing up as a import, still just gives me an error.

Share this post


Link to post
Share on other sites
Posted (edited)

when you did that, were there any errors? if it can't find it, it's not installed right

 

the sample code they provide should work once it's installed to your python dev environment

import autoit

autoit.run("notepad.exe")
autoit.win_wait_active("[CLASS:Notepad]", 3)
autoit.control_send("[CLASS:Notepad]", "Edit1", "hello world{!}")
autoit.win_close("[CLASS:Notepad]")
autoit.control_click("[Class:#32770]", "Button2")

you probably didn't install python using admin privs and using the correct install options is my guess.

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
Guest
20 minutes ago, Earthshine said:

when you did that, were there any errors? if it can't find it, it's not installed right

 

the sample code they provide should work once it's installed to your python dev environment

import autoit

autoit.run("notepad.exe")
autoit.win_wait_active("[CLASS:Notepad]", 3)
autoit.control_send("[CLASS:Notepad]", "Edit1", "hello world{!}")
autoit.win_close("[CLASS:Notepad]")
autoit.control_click("[Class:#32770]", "Button2")

you probably didn't install python using admin privs and using the correct install options is my guess.

Sorry for the late reply, still getting the error.

 

Traceback (most recent call last):
  File "C:/Users/Krum3L/PycharmProjects/AutoIt-Test/Test.py", line 1, in <module>
    import autoit
ModuleNotFoundError: No module named 'autoit'

Im unusure on how to properly remove it, tried it with pip uninstall and then tried to reinstall it but im getting the same error though.

Share this post


Link to post
Share on other sites
Posted (edited)

yeah, i just did this. it works perfectly,. you dev env is messed up.

the sample code did what it was supposed to and returned 

Quote

Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> 
================= RESTART: C:\Users\root\Desktop\hello_test.py =================
>>> 

So, I would uninstall your python and start over. I can give you the steps to install if you want. Also you must install Autoit.

 

  • download new version of python
  • run installer AS ADMINISTRATOR
  • customize the install
    • I install to C:\Python\Python38
    • Choose to associate with py launcher and make sure you are installing pylauncher
    • make sure to add python to your environment path--you probably didn't do this
    • complete python install
  • open a CMD promto AS ADMIN
    • use pip to upgrade pip if you want
    • use pip to install your module
  • Make sure you have installed AutoIt as well

use that test code to test it.

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
Guest
3 minutes ago, Earthshine said:

yeah, i just did this. it works perfectly,. you dev env is messed up.

the sample code did what it was supposed to and returned 

So, I would uninstall your python and start over. I can give you the steps to install if you want. Also you must install Autoit.

It would maybe be good if you tell me how to properly install it, its kinda wierd though since it worked yesterday...

Share this post


Link to post
Share on other sites
Posted (edited)

I updated my post. try my steps.

 

  • reboot your machine
  • download new version of python
  • run installer AS ADMINISTRATOR
  • customize the install
    • I install to C:\Python\Python38
    • Choose to associate with py launcher and make sure you are installing pylauncher
    • make sure to add python to your environment path--you probably didn't do this
    • complete python install
  • open a CMD promto AS ADMIN
    • use pip to upgrade pip if you want
    • use pip to install your module
  • Make sure you have installed AutoIt as well

use that test code to test it.

I will add some screen shots if i need to.

hmmm, if it worked yesterday then maybe files got deleted?

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
Guest

I did the exact same steps, still getting the issue though. Im unsure if this going to work out for me.

NotWorking.png

Share this post


Link to post
Share on other sites
Guest

Oops, used autoit here, tried pyautoit still didn't work.

Share this post


Link to post
Share on other sites
Guest
24 minutes ago, Earthshine said:

I updated my post. try my steps.

 

  • reboot your machine
  • download new version of python
  • run installer AS ADMINISTRATOR
  • customize the install
    • I install to C:\Python\Python38
    • Choose to associate with py launcher and make sure you are installing pylauncher
    • make sure to add python to your environment path--you probably didn't do this
    • complete python install
  • open a CMD promto AS ADMIN
    • use pip to upgrade pip if you want
    • use pip to install your module
  • Make sure you have installed AutoIt as well

use that test code to test it.

I will add some screen shots if i need to.

hmmm, if it worked yesterday then maybe files got deleted?

So, i feel really stupid because i was pretty sure that i did this already.. it seems like installing the autoit/pyautoit plugin via the pip install broke something.. My fix was to install pyautoit via the Project Interpreter -> + -> pyautoit -> install Package.

I really appreciate the Time that you took out of your day to help me out!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...