Open m-pilia opened 4 years ago
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, andpep425tags
is now calledpip._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 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_tag
andplat_name
from 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}
The following error arises when trying to build with pip 20.0
This is because
pip._internal.wheel
was moved, andpep425tags
is now calledpip._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 yoursetup.py
, and this is the reason.