Skip to content

can not install in setuptools>v57 environment #9

@momijiame

Description

@momijiame

Abstract

I found that xfeat could not be installed in an environment where the version of setuptools was v58 or higher. This issue may be due to the fact that 'ml_metrics' which xfeat depends on, ml_metrics uses 'use_2to3' option.

https://github.com/zhouyonglong/ml_metrics/blob/master/Python/setup.py#L14

However, use_2to3 option is already not supported in setuptools v58 or higher.

https://setuptools.pypa.io/en/latest/history.html#v58-0-0

Therefore, the installation will fail with the following error.

$ pip install xfeat            
Collecting xfeat
  Downloading xfeat-0.1.1-py3-none-any.whl (39 kB)
Collecting ml-metrics
  Downloading ml_metrics-0.1.4.tar.gz (5.0 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [1 lines of output]
      error in ml_metrics setup command: use_2to3 is invalid.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Note that if you have installed xfeat in the past in an environment with setuptools<v58, the installation will succeed with cached wheels.

Workaround

Downgrade setuptools < v58 and install xfeat.

$ pip install -U "setuptools<58"
$ pip install xfeat

Environment

$ sw_vers
ProductName:	macOS
ProductVersion:	12.2.1
BuildVersion:	21D62
$ python -V 
Python 3.9.10
$ pip list
Package    Version
---------- -------
pip        22.0.3
setuptools 60.6.0
wheel      0.37.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions