Python: fail to import lib during the second attempt to run script
Test Complete 12.3
Trying to import win32com.client
First run is ok.
Second run: import failed with 'NoneType' object is not callable.
After restart Test Complete the same result: first run is ok, second is failed.
Such problem with most external libraries.
How it can be fixed?
TestComplete has its own Python interpreter and you do not need to install another one, especially you should not install new interpreter into the TestComplete directory, because it can override important dependencies and cause conflicts.
You can download any required package manually and then install it using setup.py script.
Also you can install pip itself to work with your TestComplete Python installation.
TestComplete cannot work correctly with the win32com Python library because this library cannot work after the reinitialization of the Python interpreter. You can find the same information on the official SourceForge page (https://sourceforge.net/p/pywin32/bugs/445/😞 "pywin32 will never be able to play with the multiple interpreter API, nor work correctly with multiple interpreter initializations and cleanups". And, that's why, it could work successfully only one time, and, after this, you needed to relaunch the tool.