TestComplete should support all third-party Python packages available
Refer to the following case for more details:
Case # 00674899 : Getting error when running code from second time onwards
My code:
import sys
import paramiko
sys.path.append("C:\\Program Files (x86)\\SmartBear\\TestComplete 15\\Bin\\Extensions\\Python\\Python311")
sys.path.insert(0,"C:\\Program Files (x86)\\SmartBear\\TestComplete 15\\Bin\\Extensions\\Python\\Python311\\Lib")
def test():
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.close()
When I run the code first time no errors. From second time onwards, getting the following error:
ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process 11:31:05 Normal 0.00
Response from support team:
The issue you are getting appears when working with third-party Python packages in TestComplete, and this is mentioned in our docs " We do not guarantee stable work of your script tests that use third-party Python packages. When you run such tests, you may experience unexpected errors or TestComplete can stop responding"
For reference: https://support.smartbear.com/testcomplete/docs/scripting/specifics/python.html#:~:text=We%20do%20not%20guarantee%20stable%20work%20of%20your%20script%20tests%20that%20use%20third%2Dparty%20Python%20packages.%20When%20you%20run%20such%20tests%2C%20you%20may%20experience%20unexpected%20errors%20or%20TestComplete%20can%20stop%20responding.
I saw that you are trying to use Paramiko to create an SSH connection, but it's a third-party package which does not work with TestComplete Python Engine.