TestComplete error for Pandas library Import "OSError: [WinError 193] %1 is not a valid Win32
I am facing this below given error for Pandas library only via Testcomplete. I am able to add path of libraries with given code. Even other library xlrd is also working but issue only coming for Pandas library. As error is mentioning 32bit so only anomaly I see is that OS is 64 bit, TestComplete is also 64 bit but Python which is installed as part of Testcomplete is 32 bit. Whether anything to be changed to Python version of 32 bit or it is code issue;
Note: When I use Python directly on command prompt shell and try to import pandas in that compiler and run basic function of pandas so it is working there. problem seems only when I load pandas in TestComplete.
Code:
import sys
sys.path.append("C:\Program Files (x86)\SmartBear\TestComplete 15\Bin\Extensions\Python\Python38\Lib\site-packages\")
import xlrd
#sys.path.append("C:\Program Files (x86)\SmartBear\TestComplete 15\Bin\Extensions\Python\")
#pandas_loc="C:\Program Files (x86)\SmartBear\TestComplete 15\Bin\Extensions\Python\Python38\Lib\site-packages\"
#sys.path.insert(0,pandas_loc)
import pandas as pd
def main():
workbook = xlrd.open_workbook("C:\Users\user\Downloads\Test1.xls")
Error OSError: [WinError 193] %1 is not a valid Win32 application
OS Processor 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz 3.00 GHz System type 64-bit operating system, x64-based processor Edition Windows 10 Enterprise Version 20H2 OS build 19042.1466 Experience Windows Feature Experience Pack 120.2212.3920.0
TestComplete Version: 15.20.341.7 x64
Python Python 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:34:34) [MSC v.1928 32 bit (Intel)] on win32 python : 3.8.10.final.0 python-bits : 32 OS : Windows OS-release : 10 Version : 10.0.19042 machine : AMD64 processor : Intel64 Family 6 Model 140 Stepping 1, GenuineIntel byteorder : little LC_ALL : None LANG : None LOCALE : English_United States.1252
Panda Library Name: pandas Version: 1.4.1 Summary: Powerful data structures for data analysis, time series, and statistics Home-page: https://pandas.pydata.org Author: The Pandas Development Team Author-email: pandas-dev@python.org License: BSD-3-Clause Location: c:\program files (x86)\smartbear\testcomplete 15\bin\extensions\python\python38\lib\site-packages Requires: numpy, python-dateutil, pytz Required-by:
Python Libraries Package Version
numpy 1.22.2 pandas 1.4.1 pip 22.0.3 python-dateutil 2.8.2 pytz 2021.3 setuptools 56.0.0 six 1.16.0 xlrd 2.0.1