module 'pip' has no attribute 'pep425tags'

前端 未结 9 1645
感动是毒
感动是毒 2020-12-18 00:10

When I am trying to install .whl with pip

it said:

is not a supported wheel on this platform

to solve this problem, I

相关标签:
9条回答
  • 2020-12-18 00:47

    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'
    
    0 讨论(0)
  • 2020-12-18 00:52

    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
    
    0 讨论(0)
  • 2020-12-18 00:52

    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')]
    
    0 讨论(0)
  • 2020-12-18 00:52

    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")
    
    0 讨论(0)
  • 2020-12-18 00:53

    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.

    0 讨论(0)
  • 2020-12-18 01:03

    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.

    0 讨论(0)
提交回复
热议问题