heremaps / pptk

The Point Processing Toolkit (pptk) is a Python package for visualizing and processing 2-d/3-d point clouds.
https://heremaps.github.io/pptk
MIT License
610 stars 112 forks source link

Setup broken on pip 20.0 #37

Open m-pilia opened 4 years ago

m-pilia commented 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, 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.

Adrianordp commented 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, 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.

How do we fix setup.py then?

m-pilia commented 4 years ago

Hi Adriano, If I were building this for myself, I would probably just remove the python_tag and plat_name from the setup.py.

Adrianordp commented 4 years ago

Hi Adriano, If I were building this for myself, I would probably just remove the python_tag and plat_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/

bk-mtg commented 4 years ago

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}