pptk
pptk copied to clipboard
Setup broken on pip 20.0
The following error arises when trying to build with pip 20.0
Traceback (most recent call last):
File "setup.py", line 9, in <module>
from pip._internal import wheel
ImportError: cannot import name 'wheel' from 'pip._internal' (/usr/lib/python3.8/site-packages/pip/_internal/__init__.py)
This is because pip._internal.wheel was moved, and pep425tags is now called pip._internal.utils.compatibility_tags.
I would like to point out that pip._internal is indeed internal to pip, you should not be using it in your setup.py, and this is the reason.
The following error arises when trying to build with pip 20.0
Traceback (most recent call last): File "setup.py", line 9, in <module> from pip._internal import wheel ImportError: cannot import name 'wheel' from 'pip._internal' (/usr/lib/python3.8/site-packages/pip/_internal/__init__.py)This is because
pip._internal.wheelwas moved, andpep425tagsis now calledpip._internal.utils.compatibility_tags.I would like to point out that
pip._internalis indeed internal to pip, you should not be using it in yoursetup.py, and this is the reason.
How do we fix setup.py then?
Hi Adriano,
If I were building this for myself, I would probably just remove the python_tag and plat_name from the setup.py.
Hi Adriano, If I were building this for myself, I would probably just remove the
python_tagandplat_namefrom the setup.py.
Hello Martino. Thanks for your attention! I was really struggling to build it (first time dealing with a python wheel). This is my solution, if anyone wonders how to fix it as I did: - 9 from pip._internal import wheel - 11 wheel_tags = wheel.pep425tags.get_supported()[0] - 88 'python_tag': wheel_tags[0], - 89 'plat_name': wheel_tags[2]}}) + 88 'python_tag': 'py38', + 89 'plat_name': 'linux_x86_64'}}) For inclusions I followed the wheel tag convention on https://www.python.org/dev/peps/pep-0425/
Looks like the "new way" to get the same data (not clear whether it's really needed) is by importing packaging.tags. Specifically, something like:
import packaging.tags
# get the first (most detailed) tag describing this system
# analogous to wheel.pep425tags.get_supported()[0]
sys_tag = packaging.tags.sys_tags().__next__()
# tag names are now referenced by name
opts = {'python_tag': sys_tag.interpreter, 'plat_name': sys_tag.platform}