module 'pip' has no attribute 'pep425t

2019-05-10 03:13发布

When I am trying to install .whl with pip

it said:

is not a supported wheel on this platform

to solve this problem, I searched the Internet and it said I can input this into shell

import pip; print(pip.pep425tags.get_supported())

with this I can get the documents and versions that pip supports

However, when I input these code, it said:

module 'pip' has no attribute 'pep425tags'

What's wrong?

4条回答
够拽才男人
2楼-- · 2019-05-10 03:47

For pip v10 use this:

import pip._internal; print(pip._internal.pep425tags.get_supported())
查看更多
贼婆χ
3楼-- · 2019-05-10 03:58

A bash one-liner, good for both Py2.7 & Py3.6 with pip-18.1:

python3 -c "import wheel.pep425tags as w; print(w.get_supported())" |sed -zE 's/\),/),\n/g'
查看更多
手持菜刀,她持情操
4楼-- · 2019-05-10 04:00

AMD64

import pip._internal;print(pip._internal.pep425tags.get_supported())

WIN32

import pip;print(pip.pep425tags.get_supported())

then pip install <.whl> by corresponding platform wheel(https://www.lfd.uci.edu/~gohlke/pythonlibs/)

查看更多
Juvenile、少年°
5楼-- · 2019-05-10 04:08

This worked for me with Python 2.7 (in a virtualenv using that version):

import wheel.pep425tags

print(wheel.pep425tags.get_supported())
查看更多
登录 后发表回答