Guest Posted March 9, 2020 Posted March 9, 2020 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.
Moderators JLogan3o13 Posted March 9, 2020 Moderators Posted March 9, 2020 @Krum3L am I correct that you're trying to run this from python, based on the traceback? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Guest Posted March 9, 2020 Posted March 9, 2020 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.
Moderators JLogan3o13 Posted March 9, 2020 Moderators Posted March 9, 2020 Moved to the appropriate forum. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Earthshine Posted March 9, 2020 Posted March 9, 2020 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
Guest Posted March 9, 2020 Posted March 9, 2020 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.
Earthshine Posted March 9, 2020 Posted March 9, 2020 (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 March 9, 2020 by Earthshine My resources are limited. You must ask the right questions
Guest Posted March 9, 2020 Posted March 9, 2020 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.
Earthshine Posted March 9, 2020 Posted March 9, 2020 (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 March 9, 2020 by Earthshine My resources are limited. You must ask the right questions
Guest Posted March 9, 2020 Posted March 9, 2020 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...
Earthshine Posted March 9, 2020 Posted March 9, 2020 (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 March 9, 2020 by Earthshine My resources are limited. You must ask the right questions
Guest Posted March 9, 2020 Posted March 9, 2020 I did the exact same steps, still getting the issue though. Im unsure if this going to work out for me.
Guest Posted March 9, 2020 Posted March 9, 2020 Oops, used autoit here, tried pyautoit still didn't work.
Guest Posted March 9, 2020 Posted March 9, 2020 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!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now