Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

[SOLVED] ImportError: No module named win32_ctrls

Found a bug in EventGhost? Report it here.
Post Reply
User avatar
blackwind
Experienced User
Posts: 182
Joined: Wed Sep 12, 2012 2:59 am
Location: Canada
Contact:

[SOLVED] ImportError: No module named win32_ctrls

Post by blackwind »

From EventGhost 0.4.1r1610:

Code: Select all

Traceback (most recent call last):
  Python script "7", line 1, in <module>
    caption = eg.plugins.Window.GrabText(False)[0]
  File "C:\Program Files (x86)\EventGhost\plugins\Window\__init__.py", line 529, in __call__
    from win32_ctrls import win32_ctrls
ImportError: No module named win32_ctrls
Can we get a fix?
Last edited by blackwind on Wed Feb 27, 2013 4:47 am, edited 1 time in total.
/bw
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: ImportError: No module named win32_ctrls

Post by Pako »

This is weird. The file win32_ctrls.py should be located in the ...\ plugins\Window.
And when I look, I see it there as well as in the SVN repository it exists.

Pako
Cypher16e
Posts: 7
Joined: Thu Oct 08, 2015 12:58 am

Re: [SOLVED] ImportError: No module named win32_ctrls

Post by Cypher16e »

[[SKIP TO SOLUTION: viewtopic.php?f=4&t=5332&p=53552#p53552]]
I don't follow; what actions were taken to change the status of this thread to SOLVED? I'm getting the same error in my Python Script actions. Specifically, I'd like to use lxml.

According to blackwind's post at https://github.com/EventGhost/EventGhost/issues/75:

blackwind commented on Aug 13, 2016
None of the core functions or plugins use those packages. That's why they are missing.

Yep. Specifically, they were removed because of #20. You no longer have to petition Pako to include modules you want to use -- just install Python 2.7 (x86 version, as it has to match EventGhost), run pip install paramiko psutil, and EventGhost will pick them up.

I've installed the version of Python you referenced but unable to get EventGhost to overcome, "ImportError: No module named pip"

Appreciate any direction on what I'm doing wrong here, thank you gents.
Attachments
Trouble running lxml.png
Last edited by Cypher16e on Thu Aug 08, 2019 10:30 pm, edited 1 time in total.
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: [SOLVED] ImportError: No module named win32_ctrls

Post by kgschlosser »

OK

You need to install Python 2.7 x86
then install the package using the pip in that python.

c:\Python27\Scripts\pip install psutil

after the library installs then restart eventghost.
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: [SOLVED] ImportError: No module named win32_ctrls

Post by kgschlosser »

using either pip or easy_install from a frozen environment is hit or miss.

frozen = python and all of it's libraries packaged up with an application into an executable.
If you like the work I have been doing then feel free to Image
Cypher16e
Posts: 7
Joined: Thu Oct 08, 2015 12:58 am

Re: [SOLVED] ImportError: No module named win32_ctrls

Post by Cypher16e »

kgschlosser wrote: Wed Aug 07, 2019 7:57 am OK

You need to install Python 2.7 x86
then install the package using the pip in that python.

c:\Python27\Scripts\pip install psutil

after the library installs then restart eventghost.
Thank you for your input; I'm certain I'm missing something small but important still...

Installed blackwind's suggested/linked Python 2.7, ran
C:\Python27\Tools\Scripts\win_add2path.py,
then your suggestion and my target module with this output from the command line:
Trouble running lxml2.png
Looks good to me, correct?

Unfortunately, two EventGhost restarts later, I still receive in EventGhost's log:
ImportError: No module named lxml
Trouble running lxml.png

Thought pip being out of date, in some crazy unforeseen manner, *might* have something to do with it so I updated that, rechecked psutil and lxml using "python -m pip install --upgrade psutil" and restarted EventGhost again to find, "Requirement already up-to-date [...]" and the same ImportError when testing my script to import lxml.

I'll keep digging; it's gotta be something simple!

Edit: In fact, just replaced lxml with pip: same result. poo
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: [SOLVED] ImportError: No module named win32_ctrls

Post by kgschlosser »

OK you problem is simple...

Upgrade to EG 0.5

this feature is not available in 0.4.x
If you like the work I have been doing then feel free to Image
Cypher16e
Posts: 7
Joined: Thu Oct 08, 2015 12:58 am

Re: [SOLVED] ImportError: No module named win32_ctrls

Post by Cypher16e »

High five!!

Uninstalled EventGhost 0.4 Stable,
Installed EventGhost 0.5 RC6

Works -- Thank you so much!




Edit: I've included my notes of exactly how I accomplished this for other newbs:

1)
Install EventGhost (0.5 or greater)
Open EventGhost, hit Ctrl+O and load your script file (.xml),
then close EventGhost

2)
Install python-2.7.12 (x86 version to match EventGhost -- I used blackwind's suggestion at https://github.com/EventGhost/EventGhos ... -239641187 )

3)
open cmd.exe (hit Windows button or click Start then type "cmd"),
type "cd /python27\tools\scripts" {Enter},
type "win_add2path.py" {Enter},
type "cd /python27\scripts" {Enter},
type "pip install psutil" {Enter},
type "pip install lxml" {Enter},
type "exit" {Enter},
Reopen EventGhost.
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: [SOLVED] ImportError: No module named win32_ctrls

Post by kgschlosser »

no worries m8. that's why I am here.
If you like the work I have been doing then feel free to Image
Post Reply