cancel
Showing results for 
Search instead for 
Did you mean: 

Can't import win32service (python) in TestComplete

Highlighted
Contributor

Can't import win32service (python) in TestComplete

Trying to get TestComplete to see a new package that I've installed (win32serviceutil)

 

W26f6sE

It is incredibly difficult and fickle to get some 3rd party packages to work with TC, and yet others work seamlessly immediately after being installed via pip.

Any help would be appreciated.

 

More info:

g7CW7SI

The above code works.

 

ZITwrp6

The above code fails

Both my PyCharm IDE and TC are using the same compiler (the one in the TC folder)

 

I just don't understand what TC is doing that breaks Python's ability to find packages.

 

4 REPLIES 4
Highlighted
Community Hero

What bit-version of TestComplete are you running?  64-bit or 32-bit? (Help | About).

 

By default, the TestComplete shortcuts created upon install, starting with version 12.40, run the 64-bit version.  Since you're trying to load a 32-bit module, if you're running the 64-bit version, this won't work.

 

You can access the 32-bit version by running the TestComplete.exe in C:\Program Files (x86)\SmartBear\TestComplete 12\Bin\.  What you have in the way of automation shouldn't need to be adjusted assuming you don't have any code that is dependant upon 64-bit.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Contributor

32 bit version of TC/ 32 bit version of Python.


The bitness mismatch burned me a few weeks ago though, lo.

Highlighted
Contributor

Also, someone marked this post as "solved"...

... it's not.

Highlighted
Community Hero

The notifications have you marking the solution... probably by accident.

 

That said, keep in mind, I'm not a python guru.  But I took a look at the help about importing external packages (https://support.smartbear.com/testcomplete/docs/scripting/specifics/python.html#importing-packages) and I noticed that the pathing given in the sample code uses double backslashes.

 

Technically speaking, I don't THINK you need to change the sys path to import a package if it's been copyed to the TestComplete python lib folder.  However, because of that incorrect string in the path (missing double backslashes) this could be your problem.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Get properties of a web page element

See replies!

Compare images using the Region Checkpoint

See replies!

Compare HTML table with Excel file and correct data in Excel file

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!
Top Kudoed Authors