close

[Solved] ModuleNotFoundError: No module named ‘pyodbc’ when importing pyodbc into py script

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error ModuleNotFoundError: No module named ‘pyodbc’ when importing pyodbc into py script in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How ModuleNotFoundError: No module named ‘pyodbc’ when importing pyodbc into py script Error Occurs?

Today I get the following error ModuleNotFoundError: No module named ‘pyodbc’ when importing pyodbc into py script in python.

How To Solve ModuleNotFoundError: No module named ‘pyodbc’ when importing pyodbc into py script Error ?

  1. How To Solve ModuleNotFoundError: No module named 'pyodbc' when importing pyodbc into py script Error ?

    To Solve ModuleNotFoundError: No module named 'pyodbc' when importing pyodbc into py script Error It seems you have already installed the pyodbc module, but are trying to reference it from another environment.

  2. ModuleNotFoundError: No module named 'pyodbc' when importing pyodbc into py script

    To Solve ModuleNotFoundError: No module named 'pyodbc' when importing pyodbc into py script Error It seems you have already installed the pyodbc module, but are trying to reference it from another environment.

Solution 1

It seems you have already installed the pyodbc module, but are trying to reference it from another environment.

Some Steps:

  1. In the Solution Explorer window right-click Python Environments
  2. select add/remove
  3. choose your desired python interpreter.

Solution 2

I had the same problem.

import sys

print(sys.path)

It turned out that the IDE I was using, PyCharm by JetBrains, had a different directory in which I had to install pyodbc. I used cmd line prompt to navigate to the PyCharm directory and reinstalled with pip there.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read