'module 'pip' has no attribute 'pep425tags'
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 repl
import pip; print(pip.pep425tags.get_supported())
with this I can see the tags and versions that pip supports
However, when I input this code, it said:
AttributeError: module 'pip' has no attribute 'pep425tags'
What's wrong?
(pip 10.0.1 on python 3.6)
Solution 1:[1]
If the goal is simply to get the list of compatible tags, then with current versions of pip (for example 20.0.2):
$ path/to/pythonX.Y -m pip debug --verbose
Solution 2:[2]
This worked for me with Python 2.7 (in a virtualenv using that version):
import wheel.pep425tags
print(wheel.pep425tags.get_supported())
Solution 3:[3]
For pip v10 use this:
import pip._internal; print(pip._internal.pep425tags.get_supported())
Solution 4:[4]
Using Python 3.6.8 and pip 19.1.1
python -c "import wheel.pep425tags as w
print(w.get_supported())"
worked!
Output:
[('cp36', 'cp36m', 'win_amd64'), ('cp36', 'none', 'win_amd64'), ('cp36', 'none', 'any'), ('cp3', 'none', 'any'), ('cp35', 'none', 'any'), ('cp34', 'none', 'any'), ('cp33', 'none', 'any'), ('cp32', 'none', 'any'), ('cp31', 'none', 'any'), ('cp30', 'none', 'any'), ('py3', 'none', 'win_amd64'), ('py36', 'none', 'any'), ('py3', 'none', 'any'), ('py35', 'none', 'any'), ('py34', 'none', 'any'), ('py33', 'none', 'any'), ('py32', 'none', 'any'), ('py31', 'none', 'any'), ('py30', 'none', 'any')]
Solution 5:[5]
The main issue is that pep425tags was an internal thing from the wheel module. I believe it was never meant to be used like that and it was always subject to change. Facing this problem myself just now I noticed that wheel==0.34.1 has pep425tags while wheel==0.35.0 does not.
So if you really want to use this module, make sure to pip3 install wheel==0.34.1.
Solution 6:[6]
I have several versions of Python in my GNU-Linux machine and this causes some problems for me. Python 2.7, 3.4, 3.6, ...
Too messy! I know. :)
Each time I used python3 and run this code:
import wheel.pep425tags
print(wheel.pep425tags.get_supported())
As yours, I confronted with this error too:
AttributeError: 'module' object has no attribute 'pep425tags'
By surfing inside stackoverflow I noticed some problems as below that may help you:
It's important to know your pip or pip3 is set to which version of Pythons: My mine, pip is set to python 2.7 and pip3 is also set to python 3.6.
First of all, check the version of your pip or pip3:
pip -V
or
pip3 -V
As I use pip3 so it results:
pip 20.0.2 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)
This shows that my pip3 uses python3.6 and this causes me straightly go inside the python3.6 console. In this case it works and results:
[('cp36', 'cp36m', 'linux_x86_64'), ('cp36', 'abi3', 'linux_x86_64'), ('cp36', 'none', 'linux_x86_64'), ('cp35', 'abi3', 'linux_x86_64'), ('cp34', 'abi3', 'linux_x86_64'), ('cp36', 'none', 'any'), ('cp3', 'none', 'any'), ('cp35', 'none', 'any'), ('cp34', 'none', 'any'), ('cp33', 'none', 'any'), ...]
I hope these steps works for you.
Solution 7:[7]
I also have this problem. But I made a mistake following the previous approach. enter image description hereTypeError: get_supported() missing 1 required positional argument: 'archive_root' ,The solution is to add parameter win_amd64 in get_supported().
import wheel.pep425tags as w
print(w.get_supported("win_amd64")
Solution 8:[8]
Try this, if you have a new version of pip and you just want the result of get_supported function call:
python -c "from pip._internal.utils.compatibility_tags import get_supported; print(get_supported())"
Solution 9:[9]
THIS INFO IS OUTDATED
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'
Solution 10:[10]
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/)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | Tim Diekmann |
| Solution 3 | |
| Solution 4 | Adrian |
| Solution 5 | McLeary |
| Solution 6 | mabedis |
| Solution 7 | |
| Solution 8 | ULIT JAIDEE |
| Solution 9 | |
| Solution 10 |
