如何使用 python 2.7 在 Windows 上安装 pymssql?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4666290/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to install pymssql on windows with python 2.7?
提问by Cubius
It seems that there are no such binaries yet. There is an issue on googlecode: http://code.google.com/p/pymssql/issues/detail?id=12but i cannot figure out what to do with those files provided.
似乎还没有这样的二进制文件。googlecode 有一个问题:http: //code.google.com/p/pymssql/issues/detail?id=12 但我不知道如何处理提供的这些文件。
采纳答案by YOU
You may also get pymssql2.7 library from this unofficial extensions library
你也可以从这个非官方扩展库中获得 pymssql2.7 库
回答by Dave Huang
Extract the contents into the Python27\Lib\site-packages directory.
将内容解压到 Python27\Lib\site-packages 目录中。
回答by JGurtz
Combining YOU and David Huang's answers will bring success; here are some further notes that may help a beginner:
结合YOU和David Huang的答案将带来成功;以下是一些可能对初学者有所帮助的进一步说明:
Be sure to download the package that matches the bitness of your windows and also matches the version of Python you are running. I noticed on the pymssql wiki page a note about x64 not being available on Windows so test well if you choose those packages.
请务必下载与您的 Windows 位数相匹配且与您正在运行的 Python 版本相匹配的软件包。我在 pymssql wiki 页面上注意到有关 x64 在 Windows 上不可用的说明,因此如果您选择这些软件包,请进行良好测试。
It may feel a little sketchy when you notice Christoph Gohlke packages are all exe's. I used WinRAR to open the self-extractor. Inside the archive is a PLATLIB folder which itself contains two files and a folder: _mssql.pyd, pymssql.pyd, and pymssql-N.N.N-pyN.N.egg-info. These two files and the pymssql-... folder are what needs extracting into ...\Lib\site-packages.
当您注意到 Christoph Gohlke 软件包都是 exe 的时,您可能会觉得有点粗略。我用WinRAR打开自解压器。档案里面是它本身包含两个文件的文件夹的文件夹PLATLIB: ,_mssql.pyd,pymssql.pyd和pymssql-N.N.N-pyN.N.egg-info。这两个文件和 pymssql-... 文件夹是需要解压到...\Lib\site-packages.
回答by ravish.hacker
If you have pip install:
如果你有 pip 安装:
pip install pymssql
pip install pymssql
To install pip (trust me its very helpful):
安装 pip(相信我它非常有帮助):
Download and run this python script (as admin):
下载并运行此 python 脚本(以管理员身份):

