Repository: mlcommons/inference
Issue: error: Could not find suitable distribution for Requirement.parse('mlperf_loadgen')
Root cause: Configuration Error

### Discussed in https://github.com/mlcommons/inference/discussions/1013

<div type='discussions-op-text'>

<sup>Originally posted by **YingLiGithub** September  9, 2021</sup>
Hi, all.

This is the third time I try to install Mlperf. But there occurs a new problem when I run "python setup.py develop"

"running develop
running create_version
running build
running build_py
copying python/version.py -> build/lib/python
running egg_info
writing mlperf_inference.egg-info/PKG-INFO
writing dependency_links to mlperf_inference.egg-info/dependency_links.txt
writing requirements to mlperf_inference.egg-info/requires.txt
writing top-level names to mlperf_inference.egg-info/top_level.txt
reading manifest file 'mlperf_inference.egg-info/SOURCES.txt'
writing manifest file 'mlperf_inference.egg-info/SOURCES.txt'
running build_ext
Creating /usr/local/lib/python3.8/dist-packages/mlperf-inference.egg-link (link to .)
mlperf-inference 0.1.0 is already the active version in easy-install.pth

Installed /home/liying/mlperf/inference/vision/classification_and_detection
Processing dependencies for mlperf-inference==0.1.0
Searching for mlperf_loadgen
Reading https://pypi.org/simple/mlperf_loadgen/
Reading https://pypi.org/simple/mlperf-loadgen/
Couldn't find index page for 'mlperf_loadgen' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.org/simple/

No local packages or working download links found for mlperf_loadgen
error: Could not find suitable distribution for Requirement.parse('mlperf_loadgen')"


Is it because the author change the name from mlperf to mlcommons? Or other reason?

Thank you very much.
</div>

Did `python setup.py install` work for you?

> python setup.py install

I tried, but still the same problem.

mlperf_loadgen has never been on PyPI, so that message is weird. @psyhtest Has your team been using LoadGen Python binding in the submission? Did they run into this issue?

@nvpohanh Yes, we have used Python bindings lately. [Our CK package](https://github.com/krai/ck-mlperf/blob/master/package/lib-python-mlperf-loadgen/) uses [an equivalent](https://github.com/krai/ck-mlperf/blob/master/package/lib-python-mlperf-loadgen/install.sh#L35) of `python setup.py bdist_wheel` following the [official build instructions](https://github.com/mlcommons/inference/blob/master/loadgen/README_BUILD.md#quick-start). I've just tried them on an Ubuntu 20.04 machine:

```
anton@velociti:/tmp$ python3 -m pip install absl-py numpy
anton@velociti:/tmp$ git clone --recurse-submodules https://github.com/mlcommons/inference.git mlperf_inference
anton@velociti:/tmp$ cd mlperf_inference/loadgen
anton@velociti:/tmp/mlperf_inference/loadgen$ CFLAGS="-std=c++14 -O3" python setup.py bdist_wheel
anton@velociti:/tmp/mlperf_inference/loadgen$ tree dist/
dist/
└── mlperf_loadgen-1.1-cp38-cp38-linux_x86_64.whl
anton@velociti:/tmp/mlperf_inference/loadgen$ python3 -m pip install --force-reinstall dist/mlperf_loadgen-1.1-cp38-cp38-linux_x86_64.whl
anton@velociti:/tmp/mlperf_inference/loadgen$ python3 -m pip show mlperf-loadgen
Name: mlperf-loadgen
Version: 1.1
Summary: MLPerf Inference LoadGen python bindings
Home-page: https://mlperf.org
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Location: /tmp/mlperf_inference/loadgen
Requires:
Required-by:
```

Closing this issue as there are no updates/comments.

FIX: pip install pybind11

I encountered the same problem with both Debian and Ubuntu 24.04.

Hi @pvti currently you should be able to do
```
pip install mlcommons_loadgen
```

Also we do test loadgen build via github action and there should be no issue with the build. You can see the logs here for doing any comparisons. 

https://github.com/mlcommons/inference/actions/workflows/test-loadgen.yml

Hi @arjunsuresh , thank you so much for your swift reply. 

I'm trying to test the _inference time_ of resnet50 on my local machine, for 2 cases, NVIDIA GPU and Intel CPU. I've found 2 references to follow:
- https://github.com/mlcommons/inference/tree/master/vision/classification_and_detection
- https://docs.mlcommons.org/inference/

Which one should I follow? I appreciate your help.

I'm able to do `pip install mlcommons_loadgen`. However, after installing mlcommons_loadgen, [this instruction](https://github.com/mlcommons/inference/tree/master/vision/classification_and_detection#prerequisites-and-installation) still yields error:
```
(base) t@p:~/inference/vision/classification_and_detection$ python setup.py develop
/home/t/anaconda3/lib/python3.12/site-packages/setuptools/__init__.py:81: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!

        ********************************************************************************
        Requirements should be satisfied by a PEP 517 installer.
        If you are using pip, you can try `pip install --use-pep517`.
        ********************************************************************************

!!
  dist.fetch_build_eggs(dist.setup_requires)
running develop
/home/t/anaconda3/lib/python3.12/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` and ``easy_install``.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://github.com/pypa/setuptools/issues/917 for details.
        ********************************************************************************

!!
  easy_install.initialize_options(self)
/home/t/anaconda3/lib/python3.12/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
running create_version
running build
running build_py
creating build
creating build/lib
creating build/lib/python
copying python/dataset.py -> build/lib/python
copying python/version.py -> build/lib/python
copying python/backend_pytorch.py -> build/lib/python
copying python/main.py -> build/lib/python
copying python/backend_pytorch_native.py -> build/lib/python
copying python/backend_ncnn.py -> build/lib/python
copying python/coco.py -> build/lib/python
copying python/pycoco.py -> build/lib/python
copying python/__init__.py -> build/lib/python
copying python/backend_tflite.py -> build/lib/python
copying python/backend.py -> build/lib/python
copying python/backend_tvm.py -> build/lib/python
copying python/backend_onnxruntime.py -> build/lib/python
copying python/backend_tf.py -> build/lib/python
copying python/backend_null.py -> build/lib/python
copying python/imagenet.py -> build/lib/python
copying python/openimages.py -> build/lib/python
creating build/lib/python/ncnn_models
copying python/ncnn_models/resnet50.py -> build/lib/python/ncnn_models
copying python/ncnn_models/__init__.py -> build/lib/python/ncnn_models
running egg_info
creating mlperf_inference.egg-info
writing mlperf_inference.egg-info/PKG-INFO
writing dependency_links to mlperf_inference.egg-info/dependency_links.txt
writing requirements to mlperf_inference.egg-info/requires.txt
writing top-level names to mlperf_inference.egg-info/top_level.txt
writing manifest file 'mlperf_inference.egg-info/SOURCES.txt'
reading manifest file 'mlperf_inference.egg-info/SOURCES.txt'
writing manifest file 'mlperf_inference.egg-info/SOURCES.txt'
running build_ext
Creating /home/t/anaconda3/lib/python3.12/site-packages/mlperf-inference.egg-link (link to .)
Adding mlperf-inference 0.1.0 to easy-install.pth file

Installed /home/t/inference/vision/classification_and_detection
Processing dependencies for mlperf-inference==0.1.0
Searching for opencv-python-headless
Reading https://pypi.org/simple/opencv-python-headless/
Downloading https://files.pythonhosted.org/packages/d1/09/248f86a404567303cdf120e4a301f389b68e3b18e5c0cc428de327da609c/opencv_python_headless-4.10.0.84-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl#sha256=377d08a7e48a1405b5e84afcbe4798464ce7ee17081c1c23619c8b398ff18295
Best match: opencv-python-headless 4.10.0.84
Processing opencv_python_headless-4.10.0.84-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Installing opencv_python_headless-4.10.0.84-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl to /home/t/anaconda3/lib/python3.12/site-packages
Adding opencv-python-headless 4.10.0.84 to easy-install.pth file

Installed /home/t/anaconda3/lib/python3.12/site-packages/opencv_python_headless-4.10.0.84-py3.12-linux-x86_64.egg
Searching for mlperf_loadgen
Reading https://pypi.org/simple/mlperf_loadgen/
Reading https://pypi.org/simple/mlperf-loadgen/
Couldn't find index page for 'mlperf_loadgen' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.org/simple/
No local packages or working download links found for mlperf_loadgen
error: Could not find suitable distribution for Requirement.parse('mlperf_loadgen')
```

You're welcome. Please use the docs site for running MLPerf inference. The other README under individual benchmark folders were made during the benchmark creation time as a guide for vendors like Intel, Nvidia etc to develop their own optimized version. Since then they are hardly maintained as everyone focus on the optimized versions.