Reputation: 41
I can't find great support for pymssql installation support on Windows. I'm trying to connect to an enterprise database through another employee's python wrapper. This wrapper requires my installing of pymssql. The RTFM on this doesn't have very explicit instructions on the installation process of FreeTDS and OpenSSL.
All downloaded files (FreeTDS and OpenSSL) are from the RTFM link mentioned above. There is mention of adding both downloads to a C:\Program Files folder and adding the binaries into the system PATH
, so I did this:
PATH
\bin
\bsqldb.exe
\bsqldb.exe.manifest
\bsqlodbc.exe
...
\tsql.exe
\include
\bkpublic.h
\cspublic.h
\cstypes.h
...
\tds_sysdep_public.h
\lib
\static
\db-lib.lib
\iconv.lib
\libct.lib
\replacements.lib
\tds.lib
\ct.dll
\ct.dll.manifest
...
\tsodbc.lib
\lib-nossl
(same as \lib)
PATH
\HashInfo.txt
\libeay32.dll
\OpenSSL License.txt
\openssl.exe
\ReadMe.txt
\ssleay32.dll
python -m pip install pymssql
>> then check for install status:import pymssql
ImportError: DLL load failed: The specified module could not be found.
Super frustrating. Really appreciate any help here!
(unfortunately most everyone I know runs pymssql from Linux and they don't have this problem)
Upvotes: 4
Views: 5041
Reputation: 1419
Nowadays I recommend just downloading the version you need from here https://www.lfd.uci.edu/~gohlke/pythonlibs/#pymssql and then installing via below steps.
I didn't have to install anything extra, worked right out of the box.
Upvotes: 3
Reputation: 123399
As mentioned (briefly) in the pymssql documentation you cited, and also in my related answer here, your Windows PATH
needs to include the folder(s) where the DLL files reside, not the base folder(s) for FreeTDS (and OpenSSL, if required).
So, on my test machine running 32-bit Windows my PATH
needed to include the "lib-nossl" folder for FreeTDS ...
C:\Users\Gord\Downloads\freetds-v0.95.83-win-x86-vs2015\lib-nossl
... in order for me to use pymssql 2.1.2 with Python 3.5.1 to establish a non-encrypted connection to my SQL Server.
Upvotes: 3