Python Forum
mportError: DLL load failed:
Thread Rating:
  • 2 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
mportError: DLL load failed:
#1
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.
Reply
#2
You need to post runable code
Reply
#3
Have you tried reinstalling the odbc drivers? It wouldn't be a python package...
Reply
#4
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.
Reply
#5
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?
Reply
#6
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'
>>>
Reply
#7
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?
Reply
#8
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
Reply
#9
Sounds like conda doesn't have all the dependencies set, then.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Failed attempts to load Microsoft Appstore Python DLLs piyushd 0 424 Oct-31-2023, 10:43 AM
Last Post: piyushd
  DLL load failed flaviu2 5 4,078 Oct-01-2020, 02:05 PM
Last Post: snippsat
  ImportError:DLL Load Failed after importing scipy.sparse.linalg sea_jam 0 2,349 Jul-31-2020, 01:54 AM
Last Post: sea_jam
  python import sybpydb error: DLL load failed: The specified module could not be found andieDu 3 7,654 Apr-04-2018, 06:58 AM
Last Post: Larz60+
  Load spatialite in Python 3.6 on Win10 failed RTFirefly 1 5,388 Feb-19-2018, 09:59 PM
Last Post: RTFirefly

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020