简体   繁体   中英

when executing “import pyodbc” in python 3.6 (anaconda3) Jupyter Notebook throws error: ImportError: DLL load failed

What I want to accomplish:

  • execute import pyodbc statement within Jupyter Notebook and thus use pyodbc to import data from sql databases such as SQL Server, Exasol, etc.

What is the environment:

  • Anaconda3 (py36_0) installed on Windows 10 - 64 bit Version
  • pyodbc installed via conda ( conda install pyodbc ) -> this worked as conda list shows that pyodbc 4.0.16 py36_0 is installed
  • jupyter notebook works, for example import pandas works fine

What happens:

  • after issuing the command import pyodbc within the jupyter notebook, the following error message appears:

    ImportError Traceback (most recent call last) in () ----> 1 import pyodbc ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden.

Thanks in advance for any helpful answer!

I had the same problem. I don't think Anaconda is compatible with the latest pyodbc version. (see their website: https://docs.continuum.io/anaconda/pkg-docs which lists version 3.0.10 support for python 3.6)

I was able to solve this by downgrading my package using this command:

conda install -c anaconda pyodbc=3.0.10

This worked for me in my tests. Hope this helps. Please let me know if it does!

After translating the German error message, it appears you haven't installed pyodbc with Anaconda:

conda install -c anaconda pyodbc=3.0.10

That should solve your immediate problem, however, there may be some other tweaks to do to get pyodbc to run on Windows.

Updating pyodbc from 4.0.16-py36_0 to 4.0.17-py36_0 resolved the issue for me.

I ran the following conda command from the command line.

conda update pyodbc

I had the same problem

Go to https://anaconda.org/anaconda/pyodbc/files

And download https://anaconda.org/anaconda/pyodbc/3.0.10/download/win-64/pyodbc-3.0.10-py36_1.tar.bz2

In this adress \\Anaconda3\\Lib\\site-packages you look for the pyodbc.pyd and the .eggs-info file, you replace those files for the same file of the 3.0.10 version that is in the pyodbc-3.0.10-py36_1.tar.bz2.

That worked for me. Hope it also work for you

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM