简体   繁体   中英

Import odbc from Python error: Module not found

I have just started using Python and have hit a bunch of issues , some of which I have resolved going through the answers on this forum but I have hit a wall with this one. Import odbc does not work for me at all. I keep getting an error :- import odbc ImportError: DLL load failed: The specified module could not be found

I have downloaded the whl file from https://pypi.python.org/pypi/pywin32 pywin32-222-cp36-cp36m-win32.whl and installed it using pip (using the tip suggested by Sushant in Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat) ).

I can see the odbc.pyd file within the Python36-32\\Lib\\site-packages\\win32 and I can see the sys.path has Python36-32\\Lib\\site-packages. In addition, I have also tried copying the odbc.pyd file next to python.exe in \\Python\\Python36-32, but none of it has worked.

What am I missing?

After googling around, found this : https://www.lfd.uci.edu/~gohlke/pythonlibs/#pywin32

and followed this To install pywin32 system files, run python.exe Scripts/pywin32_postinstall.py -install from an elevated command prompt.

So, did a "run as admin" of cmd and executed python.exe Scripts/pywin32_postinstall.py -install.

Hope someone finds it useful.

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