记一次部署环境问题
报错内容: *.whl is not a supported wheel on this platform
先给结论
- 遇到这种问题一般是 Python版本支持的 安装包和本地Python版本有冲突;接下来以三个部分阐述下其中原理以作记录!
1. 如何查看Python支持的第三方包版本?
- 进入Python shell
>> from pip._internal.pep425tags import get_supported >> get_supported() # 打印 [ ('cp27', 'cp27mu', 'manylinux1_x86_64'), ('cp27', 'cp27mu', 'linux_x86_64'), ('cp27', 'none', 'manylinux1_x86_64'), ('cp27', 'none', 'linux_x86_64'), ('py2', 'none', 'manylinux1_x86_64'), ('py2', 'none', 'linux_x86_64'), ('cp27', 'none', 'any'),('cp2', 'none', 'any'), ('py27', 'none', 'any'), ('py2', 'none', 'any'), ('py26', 'none', 'any'), ('py25', 'none', 'any'), ('py24', 'none', 'any'), ('py23', 'none', 'any'), ('py22', 'none', 'any'), ('py21', 'none', 'any'), ('py20', 'none', 'any') ]
2.Python安装包的三种方式
我们以pymysql
为例
- 1.pip install [-i http://xxx] pymysql
- 2.whl包下载
- 3.源码压缩包下载