Forum Discussion

naveens33's avatar
naveens33
Occasional Visitor
5 years ago

Connecting to SQL server database using pyodbc in testcomplete

I have installed pyodbc in my machine. Also, I have viewed the solution for including python libraries in test complete and written below code,

 

 

from os import sys
sys.path.insert(0, "C:\\Users\\UserName\\AppData\\Local\\Programs\\Python\\Python37\\Lib\\site-packages")
import pyodbc

 

But still I am getting  ModuleNotFoundError: No module named 'pyodbc'. So, I can understand the above solution will work only for including simple libraries(.py files). But for modules like pyodbc kindly suggest some solution. And also i know we can able to do through ADO object but, we are preferred much on  pyodbc.  

 

Any help will be appreciated,

thanks in advance.

naveens33

 

Note: please find the attached screenshot of the file location "C:\\Users\\UserName\\AppData\\Local\\Programs\\Python\\Python37\\Lib\\site-packages"