pythonvisual-studio-codepypyodbc

Import pyodbc in Visual Studio Code


I would like to access SQL Data from Visual Studio Code, following this tutorial Access Azure SQL Database from Visual Studio Code using Python it caught an error when I tried to import pyodbc with

import pyodbc

the error:

ModuleNotFoundError                       Traceback (most recent call last)
 in 
----> 1 import pyodbc

ModuleNotFoundError: No module named 'pyodbc'

I then followed this tutorial: Step 1: Configure development environment for pyodbc Python development to install pyodbc. I installed the Microsoft ODBC Driver for SQL Server on Windows but the error remained. What is wrong? Is there an alternative way to access SQL data from Visual Studio Code?


Solution

  • If anybody still needs some help my problem was installing python through the Microsoft store.

    The fix was to uninstall python and install it using official website

    after that just follow the guide you already provided