0

I want to install some python packages ( importlib_metadata threadpoolctl) from source. They have pyproject.toml setup.cfg files, but there's no setup.py file. So when I try to install them, they give the same errors:

Traceback (most recent call last):
  File "utils/scanpypi", line 750, in <module>
    main()
  File "utils/scanpypi", line 698, in main
    package.load_setup()
  File "utils/scanpypi", line 300, in load_setup
    s_file, s_path, s_desc = imp.find_module('setup', [self.tmp_extract])
  File "/usr/lib/python3.8/imp.py", line 296, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named 'setup'

Can I get some help, pls?

Clifford
  • 88,407
  • 13
  • 85
  • 165
kinder chen
  • 1,371
  • 5
  • 15
  • 25

1 Answers1

4

Your package uses PEP517 rather than setuptools or distutils. Support for PEP517 was added to Buildroot in 2022.05. Make sure you have a recent Buildroot version and set PYTHON_FOO_SETUP_TYPE to flit. See the manual for details.

Support for PEP517 was not yet added to the scanpypi utility, but there's a patch for it.

Arnout
  • 2,927
  • 16
  • 24
  • thanks, there are `flit` and `pep517`, which one I should use? I also tried the patch, but it failed. – kinder chen Oct 26 '22 at 03:13
  • Did the patch fail to apply or did scanpypi still not work after applying the patch? In the latter case, please report this problem on the mailing list (you can do that via lore.kernel.org). As to whether to use flit or pep517 - I am actually not sure myself. I think flit should be pretty safe since it's a superset of pep517. – Arnout Oct 27 '22 at 07:18
  • `flit` and `pep517` work, so I ignore the patch way, do you mind helping check this [question](https://stackoverflow.com/questions/74223700/numpy-distutils-system-info-notfounderror-no-blas-lapack-libraries-found), I appreciate your help – kinder chen Oct 27 '22 at 14:27