I want to connect SQL server 2012/2014 from my windows machine using Python. For that I installed pyodbc module to my virtual environment using command below
pip install pyodbc
However, it gave me the message below when I run my script
import pyodbc ImportError: No module named pyodbc
Here is my code:
import pyodbc
db= pyodbc.connect(driver='{SQL Server Native Client 11.0}',
server='127.0.0.1',
database='master',
trusted_connection='yes')
db.close()
The module has already installed and it's listed when I use pip list. I have been searching around but with no luck on finding the solution on what exactly cause that issue.
Any helps will be appropriated.