python lib is not recognized as valid win32 app
Hi,
I have working script that runs on my PC well.
I'm trying to run the same script via TestComplete.
Both my PC and TC are using same version of Python (3.4) and both are 64bit.
But for some reason, when running the script via TC, i get this error message:
ImportError: DLL load failed: %1 is not a valid Win32 application
Now, the import that fails is not of an external lib - i'm trying to import valid working Python lib:
from urllib.request import urlopen
Also, importing just urllib works fine - only when trying to import urllib.request - i get this error.
Googling this issue, i can tell that most offered solutions talks about the library being damaged and needs to be replaced, but since i can run this script via CMD on the same PC - clearly this is not the case.
Any ideas?
Thanks,
Nadav.
If you're using 64-bit TestComplete, you can't call a 32-bit 3rd party library. Run the 32-bit TestComplete that is installed on your system (typically found in C:\Program Files (x86)\SmartBear\TestComplete 12\bin) and try again,.
To solve it for future users with the same problems:
The reason i could not access the Python 3.6 and kept being directed to the 3.4 is that my code used an external library (numpy) that wasn't installed correctly in the TestComplete 3.6, and so, when my code tried to import it - it went to the 3.4 - where the numpy WAS installed.
Installing the numpy corectly on the 3.6 - solved the issue and indeed there is NO issue with having 2 versions of Python on the same PC.
Here is a link for the numpy installation issue:
chears,
Nadav.