WIN10 environment Python3 Installing SQL Server pits is really a lot, it took a day to finally create the environment ....
The first error ...., show Cann ' t open include file:vcruntime, this should be no VC running environment ... Since my Python version is 3.7, I need to find the corresponding VC environment, the error prompt shows that the corresponding VC in Microsoft Visual Studio 14.0 is 2015 This environment can be downloaded from the Microsoft website (different versions of Pythton corresponding VC, Can be found on the Internet, if the mismatch will definitely error)
Second error .... Error hint, cannot open include file ' Sqlfront.h ', later on-line random search, on this site: http://pymssql.org/en/latest/freetds.html#windows There is an explanation,
The general meaning is to say in fact pymssql is dependent on a call freetds things, check it is a C language link sqlserve public open Source Library, this URL provides a connection, download the corresponding version, my is freetds-v0.95.95-win-x86_ 64-vs2015, after the download there are 4 folders (as if only 2 folders are useful), copy the contents of the include file into the Python include folder, copy the contents of the Lib-nossl file into the Libs folder in Python.
A third pit .... After resolving the above two errors, just follow the usual pip install pymssql, the result is an error.
Download the appropriate version of the Pymssql module from the URL below
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pymssql
My version corresponds to PYMSSQL-2.1.4.DEV5-CP37-CP37M-WIN_AMD64.WHL (37 of the file should be python37 meaning). But you don't understand what this file is? Install files or drivers? To know the great God can tell me ha ...
Finally, do not apply pip install pymssql This command, but instead of the PIP install PYMSSQL-2.1.4.DEV5-CP37-CP37M-WIN_AMD64.WHL, the installation will prompt after successful, Pymssql has been installed in the package (similar to the hint, specifically forgot)
So far .... Finally complete the installation ... Share with friends ....
PYTHON3 installation of SQL Server method in WIN10 environment