Python Forum

Full Version: mportError: DLL load failed:
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Windows 7 Anaconda3 4.3.1

I've developed a script to insert files to into SQL. It worked fine for weeks and now I get the following: 



  File "DirectorySweeper3.1.py", line 2, in <module>
    import pyodbc
ImportError: DLL load failed: The specified procedure could not be found.


I've research and found nothing helpful (although I'm not the savvy) What I did do:

1) Set the path environment variable to Lib,libs,libaray,DLLs
2) reinstalled pyodbc
3) reinstall anaconda3

My only theory on what changed would be an automatic update pushed from our IT department.
You need to post runable code
Have you tried reinstalling the odbc drivers? It wouldn't be a python package...
I'll try to reinstall ODBC drivers. I would post runnable code, but it won't run! 2nd line kills it


import os
import pyodbc  < ------ Oucch!!!!
import codecs
import datetime
import sys
import time
import math

I tried to reinstall ODBC driver from microsoft. No luck.

I've also tried to reinstall C++ run-time libraries. Still no luck.
It's amazing how little there is on this error. Can anyone think of a workaround? Another module? How would one look deeper into this problem?
Have you tried with wheel.
Quick test with virtual environment that i use for a lot stuff.
E:\1py_div
λ python -m venv pyodbc_test
E:\1py_div
λ cd pyodbc_test
E:\1py_div\pyodbc_test
λ E:\1py_div\pyodbc_test\Scripts\activate.bat
(pyodbc_test) E:\1py_div\pyodbc_test
λ pip install pyodbc-4.0.16-cp36-cp36m-win32.whl
Processing e:\1py_div\pyodbc_test\pyodbc-4.0.16-cp36-cp36m-win32.whl
Installing collected packages: pyodbc
Successfully installed pyodbc-4.0.16

(pyodbc_test) E:\1py_div\pyodbc_test
λ python
Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyodbc
>>> pyodbc.version
'4.0.16'
>>>
Thanks snipsatt, I'll look into this. I know not what it is but I would like another troubleshooting tool.

I ran this test. Pretty neat. It worked perfect. Looked like it installed, imported and reported the version. So this works but I still get he DLL error. How to proceed?
I resloved this by uninstalling pyodbc with conda-install and installing with pip. I have no idea why it makes a different but I'm up and running
Sounds like conda doesn't have all the dependencies set, then.