最近,我只是尝试在python中连接我的SQL Server。所以我只需从" http://www.lfd.uci.edu/~gohlke/pythonlibs/#pymssql"下载.whl文件。 在cmd窗口中,我使用以下命令:
pip install some-package.whl
我的电脑是64位窗口,我在下面尝试了所有的.whl文件。 http://www.lfd.uci.edu/~gohlke/pythonlibs/#pymssql
pymssql‑1.0.3‑cp27‑none‑win32.whl
pymssql‑2.1.3‑cp27‑cp27m‑win32.whl
pymssql‑2.1.3‑cp27‑cp27m‑win_amd64.whl
pymssql‑2.1.3‑cp34‑cp34m‑win32.whl
pymssql‑2.1.3‑cp34‑cp34m‑win_amd64.whl
pymssql‑2.1.3‑cp35‑cp35m‑win32.whl
pymssql‑2.1.3‑cp35‑cp35m‑win_amd64.whl
pymssql‑2.1.3‑cp36‑cp36m‑win32.whl
pymssql‑2.1.3‑cp36‑cp36m‑win_amd64.whl
但无法安装,错误消息,此系统不支持.whl文件。我该怎么办。有人可以帮助我。
答案 0 :(得分:1)
我遇到了同样的问题。它适用于系统上安装的Python版本,如果它是32位Python版本或64位Python。
所以cp36因为我有python 3.6和win32,因为根据我的系统,Python是32位。
我为我工作。
我希望这会有所帮助。
答案 1 :(得分:0)
命名结构:
{distribution} - {version}( - {build tag})? - {python tag} - {abi tag} - {platform tag} .whl
在你的情况下你需要知道你的python --version
(python2.7的python标签cp27等)和你的cpu架构。
答案 2 :(得分:0)
面对同样的问题, 您需要做的就是更改您的whl文件的名称:
更改为已安装的python发行版 然后,对于python版本,对于平台,都没有
应该像
pymssql‑2.1.3‑cp3‑none‑eny.whl
答案 3 :(得分:0)
您可以使用 packaging 执行此操作。
pip install packaging
您可以使用我编写的这个简单函数 compatible_wheels
使用打包过滤出适合您系统的轮子:
from packaging.tags import sys_tags
def parse_tag(wheel_filename):
"""
Example:
>>> parse_tag('pymssql-2.2.1-cp36-cp36m-manylinux2010_i686.whl')
'cp36-cp36m-manylinux2010_i686'
"""
return '-'.join(wheel_filename.split('-')[2:])[:-4]
def compatible_wheels(wheel_filenames):
tags = [str(tag) for tag in sys_tags()]
return [
f
for f in wheel_filenames
if parse_tag(f) in tags
]
>>> wheel_filenames = [
'pymssql-2.2.1-cp36-cp36m-manylinux2010_i686.whl',
'pymssql-2.2.1-cp36-cp36m-manylinux2014_i686.whl',
'pymssql-2.2.1-cp37-cp37m-manylinux1_i686.whl',
'pymssql-2.2.1-cp39-cp39-manylinux2014_i686.whl',
'pymssql-2.2.1-cp37-cp37m-win32.whl',
'pymssql-2.2.1-cp36-cp36m-manylinux_2_24_x86_64.whl',
'pymssql-2.2.1-cp37-cp37m-manylinux2010_x86_64.whl',
'pymssql-2.2.1-cp37-cp37m-manylinux2014_i686.whl',
'pymssql-2.2.1-cp38-cp38-manylinux2014_i686.whl',
'pymssql-2.2.1-cp36-cp36m-manylinux_2_24_i686.whl',
'pymssql-2.2.1-cp38-cp38-macosx_10_14_x86_64.whl',
'pymssql-2.2.1-cp38-cp38-manylinux2014_x86_64.whl',
'pymssql-2.2.1-cp38-cp38-win_amd64.whl',
'pymssql-2.2.1-cp39-cp39-win32.whl',
'pymssql-2.2.1-cp39-cp39-manylinux_2_24_x86_64.whl',
'pymssql-2.2.1-cp39-cp39-win_amd64.whl',
'pymssql-2.2.1-cp39-cp39-manylinux2014_x86_64.whl',
'pymssql-2.2.1-cp38-cp38-manylinux2010_x86_64.whl',
'pymssql-2.2.1-cp38-cp38-manylinux_2_24_x86_64.whl',
'pymssql-2.2.1-cp38-cp38-win32.whl',
'pymssql-2.2.1-cp39-cp39-manylinux2010_i686.whl',
'pymssql-2.2.1-cp39-cp39-manylinux_2_24_i686.whl',
'pymssql-2.2.1-cp37-cp37m-macosx_10_14_x86_64.whl',
'pymssql-2.2.1-cp37-cp37m-manylinux2010_i686.whl',
'pymssql-2.2.1-cp38-cp38-manylinux1_i686.whl',
'pymssql-2.2.1-cp38-cp38-manylinux_2_24_i686.whl',
'pymssql-2.2.1-cp37-cp37m-manylinux2014_x86_64.whl',
'pymssql-2.2.1-cp36-cp36m-manylinux2010_x86_64.whl',
'pymssql-2.2.1-cp39-cp39-manylinux1_x86_64.whl',
'pymssql-2.2.1-cp36-cp36m-manylinux1_x86_64.whl',
'pymssql-2.2.1-cp37-cp37m-manylinux1_x86_64.whl',
'pymssql-2.2.1-cp39-cp39-manylinux1_i686.whl',
'pymssql-2.2.1-cp36-cp36m-manylinux1_i686.whl',
'pymssql-2.2.1-cp36-cp36m-manylinux2014_x86_64.whl',
'pymssql-2.2.1-cp37-cp37m-manylinux_2_24_i686.whl',
'pymssql-2.2.1-cp37-cp37m-manylinux_2_24_x86_64.whl',
'pymssql-2.2.1-cp37-cp37m-win_amd64.whl',
'pymssql-2.2.1-cp38-cp38-manylinux2010_i686.whl',
'pymssql-2.2.1-cp38-cp38-manylinux1_x86_64.whl',
'pymssql-2.2.1-cp39-cp39-macosx_10_14_x86_64.whl',
'pymssql-2.2.1-cp39-cp39-manylinux2010_x86_64.whl',
]
>>> compatible_wheels(wheel_filenames)
['pymssql-2.2.1-cp39-cp39-manylinux_2_24_x86_64.whl', 'pymssql-2.2.1-cp39-cp39-manylinux2014_x86_64.whl', 'pymssql-2.2.1-cp39-cp39-manylinux1_x86_64.whl', 'pymssql-2.2.1-cp39-cp39-manylinux2010_x86_64.whl']
# Note: I get the above output because I am using Linux. You may be getting the wheels for windows accordingly based on your system.