1

I used pip to install pyodbc.

C:\Windows\system32>pip install pyodbc
Requirement already satisfied: pyodbc in c:\users\username\appdata\local\programs\python\python37\lib\site-packages (4.0.28)

But if I simply import pyodbc it gives me an error:

C:\Windows\system32>python
Python 3.7.5 (tags/v3.7.5:5c02a39a0b, Oct 15 2019, 00:11:34) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyodbc
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: DLL load failed: The specified module could not be found.
Serdia
  • 4,242
  • 22
  • 86
  • 159
  • If you run `python -m pip install pyodbc` what happens? `pip` by itself may point to a different interpreter – C.Nivs Dec 24 '19 at 02:01
  • You also may want to check `python -m pip -V` and `pip -V` to see if they are the same – C.Nivs Dec 24 '19 at 02:07
  • Thanks. This is what I got: `C:\>python -m pip -V pip 19.3.1 from C:\Users\username\AppData\Local\Programs\Python\Python37\lib\site-packages\pip (python 3.7) ---------------------------------------------------------------------------- C:\>pip -V pip 19.3.1 from c:\users\username\appdata\local\programs\python\python37\lib\site-packages\pip (python 3.7)` C:\> – Serdia Dec 24 '19 at 02:21

1 Answers1

1

If you are using the latest version, then roll back to the one before. My project worked perfectly with 4.0.27 version of this driver, but when I upgraded to 4.0.28 it stopped working (with exactly the same message as you were having)

I reverted back and it now works again.

badger28
  • 26
  • 1