方法一:新方法篇
直接用pip debug --verbose
命令即可看 pip 支持。
注: 感谢 lukea 小伙伴的分享!
详细代码如下:
C:\Users\Administrator>pip debug --verbose
WARNING: This command is only meant for debugging. Do not use this with automati
on for parsing and getting these details, since the output and options of this c
ommand may change without notice.
pip version: pip 20.0.2 from d:\python\lib\site-packages\pip (python 3.6)
sys.version: 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit
(Intel)]
sys.executable: d:\python\python.exe
sys.getdefaultencoding: utf-8
sys.getfilesystemencoding: utf-8
locale.getpreferredencoding: cp936
sys.platform: win32
sys.implementation:
name: cpython
'cert' config value: install
REQUESTS_CA_BUNDLE: None
CURL_CA_BUNDLE: None
pip._vendor.certifi.where(): d:\python\lib\site-packages\pip\_vendor\certifi\cac
ert.pem
Compatible tags: 24
cp36-cp36m-win32
cp36-abi3-win32
cp36-none-win32
cp35-abi3-win32
cp34-abi3-win32
cp33-abi3-win32
cp32-abi3-win32
py36-none-win32
py3-none-win32
py35-none-win32
py34-none-win32
py33-none-win32
py32-none-win32
py31-none-win32
py30-none-win32
cp36-none-any
py36-none-any
py3-none-any
py35-none-any
py34-none-any
py33-none-any
py32-none-any
py31-none-any
py30-none-any
方法二:常规方法篇
64 位 pip 老的查看方法前段时间更新后就不能用了。
之前导入pip._internal
就好了。
现在需要导入 pip._internal.pep425tags
才可以。
>>> import pip._internal.pep425tags
>>> print(pip._internal.pep425tags.get_supported())
[('cp36', 'cp36m', 'win32'), ('cp36', 'none', 'win32'), ('py3', 'none', 'win32')
, ('cp36', 'none', 'any'), ('cp3', 'none', 'any'), ('py36', 'none', 'any'), ('py
3', 'none', 'any'), ('py35', 'none', 'any'), ('py34', 'none', 'any'), ('py33', '
none', 'any'), ('py32', 'none', 'any'), ('py31', 'none', 'any'), ('py30', 'none'
, 'any')]
>>>
方法三:万能方法
我们直接在 pip 里搜 pep425tags.py 这个文件就行,找到它的位置。
一般导入报错就说明位置不对,每个版本都可能有一些差异,位置可能有变化。
我下载了个 32 位的,查找发现了它的位置,然后直接导入它就行了。
>>> import pip._internal.pep425tags as e
>>> print(e.get_supported())
[<cp36-cp36m-win32 @ 36751360>, <cp36-abi3-win32 @ 36751040>, <cp36-none-win32 @
36751080>, <cp35-abi3-win32 @ 36752000>, <cp34-abi3-win32 @ 36752200>, <cp33-ab
i3-win32 @ 40114816>, <cp32-abi3-win32 @ 40114856>, <py36-none-win32 @ 40114936>
, <py3-none-win32 @ 40114976>, <py35-none-win32 @ 40115016>, <py34-none-win32 @
40115056>, <py33-none-win32 @ 40115096>, <py32-none-win32 @ 40115136>, <py31-non
e-win32 @ 40115176>, <py30-none-win32 @ 40115216>, <cp36-none-any @ 40115256>, <
py36-none-any @ 40115296>, <py3-none-any @ 40115336>, <py35-none-any @ 40115376>
, <py34-none-any @ 40115416>, <py33-none-any @ 40115456>, <py32-none-any @ 40115
536>, <py31-none-any @ 40115576>, <py30-none-any @ 40115616>]
喜欢的点个赞❤吧!