Repository: open-compass/opencompass
Issue: [Bug] opencompass install error  on python 3.11
Root cause: External Dependency Breakage

### Prerequisite

- [x] I have searched [Issues](https://github.com/open-compass/opencompass/issues/) and [Discussions](https://github.com/open-compass/opencompass/discussions) but cannot get the expected help.
- [x] The bug has not been fixed in the [latest version](https://github.com/open-compass/opencompass).

### Type

I'm evaluating with the officially supported tasks/models/datasets.

### Environment

(opencompass) haitao@zjlab02:~$ python -c "import opencompass.utils;import pprint;pprint.pprint(dict(opencompass.utils.collect_env()))"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'opencompass'


### Reproduces the problem - code/configuration sample

(opencompass) haitao@zjlab02:~$   pip install -U opencompass
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting opencompass
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/8e/3e/28a1094c614341220b0158501bb0e5fe33aa38f9ace8f1ac6cf801069b35/opencompass-0.4.1-py3-none-any.whl (2.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.7/2.7 MB 5.5 MB/s eta 0:00:00
Requirement already satisfied: absl-py in /data/haitao/miniconda3/envs/opencompass/lib/python3.11/site-packages (from opencompass) (2.1.0)
Requirement already satisfied: accelerate>=0.19.0 in /data/haitao/miniconda3/envs/opencompass/lib/python3.11/site-packages (from opencompass) (1.4.0)
Collecting cpm-kernels (from opencompass)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/af/84/1831ce6ffa87b8fd4d9673c3595d0fc4e6631c0691eb43f406d3bf89b951/cpm_kernels-1.0.11-py3-none-any.whl (416 kB)
Requirement already satisfied: datasets>=2.12.0 in /data/haitao/miniconda3/envs/opencompass/lib/python3.11/site-packages (from opencompass) (3.4.0)
Requirement already satisfied: einops>=0.5.0 in /data/haitao/miniconda3/envs/opencompass/lib/python3.11/site-packages (from opencompass) (0.8.1)
Collecting evaluate>=0.3.0 (from opencompass)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/a2/e7/cbca9e2d2590eb9b5aa8f7ebabe1beb1498f9462d2ecede5c9fd9735faaf/evaluate-0.4.3-py3-none-any.whl (84 kB)
Collecting func-timeout (from opencompass)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/b3/0d/bf0567477f7281d9a3926c582bfef21bff7498fc0ffd3e9de21811896a0b/func_timeout-4.3.5.tar.gz (44 kB)
  Preparing metadata (setup.py) ... done
Collecting fuzzywuzzy (from opencompass)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/43/ff/74f23998ad2f93b945c0309f825be92e04e0348e062026998b5eefef4c33/fuzzywuzzy-0.18.0-py2.py3-none-any.whl (18 kB)
Collecting gradio-client (from opencompass)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/15/c8/0df7f92c8f1bdf5c244c29de8cd7e33a5931768ddba245526a770bfa18a2/gradio_client-1.8.0-py3-none-any.whl (322 kB)
Collecting h5py (from opencompass)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/03/71/c99f662d4832c8835453cf3476f95daa28372023bda4aa1fca9e97c24f09/h5py-3.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.5/4.5 MB 998.3 kB/s eta 0:00:00
Collecting httpx==0.27.2 (from opencompass)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/56/95/9377bcb415797e44274b51d46e3249eba641711cf3348050f76ee7b15ffc/httpx-0.27.2-py3-none-any.whl (76 kB)
Requirement already satisfied: huggingface-hub in /data/haitao/miniconda3/envs/opencompass/lib/python3.11/site-packages (from opencompass) (0.29.3)
Collecting immutabledict (from opencompass)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/59/56/25ca7b848164b7d93dbd5fc97dd7751700c93e324fe854afbeb562ee2f98/immutabledict-4.2.1-py3-none-any.whl (4.7 kB)
Requirement already satisfied: importlib-metadata in /data/haitao/miniconda3/envs/opencompass/lib/python3.11/site-packages (from opencompass) (8.6.1)
Collecting jieba (from opencompass)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/c6/cb/18eeb235f833b726522d7ebed54f2278ce28ba9438e3135ab0278d9792a2/jieba-0.42.1.tar.gz (19.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 19.2/19.2 MB 326.3 kB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting json5 (from opencompass)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/aa/42/797895b952b682c3dafe23b1834507ee7f02f4d6299b65aaa61425763278/json5-0.10.0-py3-none-any.whl (34 kB)
Collecting jsonlines (from opencompass)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/f8/62/d9ba6323b9202dd2fe166beab8a86d29465c41a0288cbe229fac60c1ab8d/jsonlines-4.0.0-py3-none-any.whl (8.7 kB)
Collecting mmengine-lite (from opencompass)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/38/2d/06997f8e4dcd6e009d2f1dd6d02b0cf089025a418e9a239663b0d23e6037/mmengine_lite-0.10.7-py3-none-any.whl (452 kB)
Requirement already satisfied: nltk>=3.7 in /data/haitao/miniconda3/envs/opencompass/lib/python3.11/site-packages (from opencompass) (3.9.1)
Requirement already satisfied: numpy<2.0.0,>=1.23.4 in /data/haitao/miniconda3/envs/opencompass/lib/python3.11/site-packages (from opencompass) (1.26.4)
Requirement already satisfied: openai in /data/haitao/miniconda3/envs/opencompass/lib/python3.11/site-packages (from opencompass) (1.66.3)
Collecting OpenCC (from opencompass)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/bb/07/4eef5a5c43221470af3a9e12fce024c5b9451618c4307c7980c2d6e298b3/OpenCC-1.1.9-cp311-cp311-manylinux2014_x86_64.whl (1.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.7/1.7 MB 317.7 kB/s eta 0:00:00
Requirement already satisfied: opencv-python-headless in /data/haitao/miniconda3/envs/opencompass/lib/python3.11/site-packages (from opencompass) (4.11.0.86)
Collecting pandas<2.0.0 (from opencompass)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/56/73/3351beeb807dca69fcc3c4966bcccc51552bd01549a9b13c04ab00a43f21/pandas-1.5.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.0/12.0 MB 356.7 kB/s eta 0:00:00
Collecting prettytable (from opencompass)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/02/c7/5613524e606ea1688b3bdbf48aa64bafb6d0a4ac3750274c43b6158a390f/prettytable-3.16.0-py3-none-any.whl (33 kB)
Requirement already satisfied: protobuf in /data/haitao/miniconda3/envs/opencompass/lib/python3.11/site-packages (from opencompass) (3.20.3)
Collecting pyext (from opencompass)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/b0/be/9b6005ac644aaef022527ce49617263379e49dbdbd433d1d3dd66d71f570/pyext-0.7.tar.gz (7.8 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [9 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-h2yxkx0o/pyext_1ca39f1caf474f47926ac39b66bcb1ff/setup.py", line 6, in <module>
          import pyext
        File "/tmp/pip-install-h2yxkx0o/pyext_1ca39f1caf474f47926ac39b66bcb1ff/pyext.py", line 117, in <module>
          oargspec = inspect.getargspec
                     ^^^^^^^^^^^^^^^^^^
      AttributeError: module 'inspect' has no attribute 'getargspec'. Did you mean: 'getargs'?
      [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.


### Reproduces the problem - command or script

pip install opencompass

### Reproduces the problem - error message

(opencompass) haitao@zjlab02:~$ pip install opencompass
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting opencompass
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/8e/3e/28a1094c614341220b0158501bb0e5fe33aa38f9ace8f1ac6cf801069b35/opencompass-0.4.1-py3-none-any.whl (2.7 MB)
Requirement already satisfied: absl-py in /data/haitao/miniconda3/envs/opencompass/lib/python3.11/site-packages (from opencompass) (2.1.0)
Requirement already satisfied: accelerate>=0.19.0 in /data/haitao/miniconda3/envs/opencompass/lib/python3.11/site-packages (from opencompass) (1.4.0)
Collecting cpm-kernels (from opencompass)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/af/84/1831ce6ffa87b8fd4d9673c3595d0fc4e6631c0691eb43f406d3bf89b951/cpm_kernels-1.0.11-py3-none-any.whl (416 kB)
Requirement already satisfied: datasets>=2.12.0 in /data/haitao/miniconda3/envs/opencompass/lib/python3.11/site-packages (from opencompass) (3.4.0)
Requirement already satisfied: einops>=0.5.0 in /data/haitao/miniconda3/envs/opencompass/lib/python3.11/site-packages (from opencompass) (0.8.1)
Collecting evaluate>=0.3.0 (from opencompass)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a2/e7/cbca9e2d2590eb9b5aa8f7ebabe1beb1498f9462d2ecede5c9fd9735faaf/evaluate-0.4.3-py3-none-any.whl (84 kB)
Collecting func-timeout (from opencompass)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/b3/0d/bf0567477f7281d9a3926c582bfef21bff7498fc0ffd3e9de21811896a0b/func_timeout-4.3.5.tar.gz (44 kB)
  Preparing metadata (setup.py) ... done
Collecting fuzzywuzzy (from opencompass)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/43/ff/74f23998ad2f93b945c0309f825be92e04e0348e062026998b5eefef4c33/fuzzywuzzy-0.18.0-py2.py3-none-any.whl (18 kB)
Collecting gradio-client (from opencompass)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/15/c8/0df7f92c8f1bdf5c244c29de8cd7e33a5931768ddba245526a770bfa18a2/gradio_client-1.8.0-py3-none-any.whl (322 kB)
Collecting h5py (from opencompass)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/03/71/c99f662d4832c8835453cf3476f95daa28372023bda4aa1fca9e97c24f09/h5py-3.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.5 MB)
Collecting httpx==0.27.2 (from opencompass)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/56/95/9377bcb415797e44274b51d46e3249eba641711cf3348050f76ee7b15ffc/httpx-0.27.2-py3-none-any.whl (76 kB)
Requirement already satisfied: huggingface-hub in /data/haitao/miniconda3/envs/opencompass/lib/python3.11/site-packages (from opencompass) (0.29.3)
Collecting immutabledict (from opencompass)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/59/56/25ca7b848164b7d93dbd5fc97dd7751700c93e324fe854afbeb562ee2f98/immutabledict-4.2.1-py3-none-any.whl (4.7 kB)
Requirement already satisfied: importlib-metadata in /data/haitao/miniconda3/envs/opencompass/lib/python3.11/site-packages (from opencompass) (8.6.1)
Collecting jieba (from opencompass)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c6/cb/18eeb235f833b726522d7ebed54f2278ce28ba9438e3135ab0278d9792a2/jieba-0.42.1.tar.gz (19.2 MB)
  Preparing metadata (setup.py) ... done
Collecting json5 (from opencompass)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/aa/42/797895b952b682c3dafe23b1834507ee7f02f4d6299b65aaa61425763278/json5-0.10.0-py3-none-any.whl (34 kB)
Collecting jsonlines (from opencompass)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f8/62/d9ba6323b9202dd2fe166beab8a86d29465c41a0288cbe229fac60c1ab8d/jsonlines-4.0.0-py3-none-any.whl (8.7 kB)
Collecting mmengine-lite (from opencompass)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/38/2d/06997f8e4dcd6e009d2f1dd6d02b0cf089025a418e9a239663b0d23e6037/mmengine_lite-0.10.7-py3-none-any.whl (452 kB)
Requirement already satisfied: nltk>=3.7 in /data/haitao/miniconda3/envs/opencompass/lib/python3.11/site-packages (from opencompass) (3.9.1)
Requirement already satisfied: numpy<2.0.0,>=1.23.4 in /data/haitao/miniconda3/envs/opencompass/lib/python3.11/site-packages (from opencompass) (1.26.4)
Requirement already satisfied: openai in /data/haitao/miniconda3/envs/opencompass/lib/python3.11/site-packages (from opencompass) (1.66.3)
Collecting OpenCC (from opencompass)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/bb/07/4eef5a5c43221470af3a9e12fce024c5b9451618c4307c7980c2d6e298b3/OpenCC-1.1.9-cp311-cp311-manylinux2014_x86_64.whl (1.7 MB)
Requirement already satisfied: opencv-python-headless in /data/haitao/miniconda3/envs/opencompass/lib/python3.11/site-packages (from opencompass) (4.11.0.86)
Collecting pandas<2.0.0 (from opencompass)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/56/73/3351beeb807dca69fcc3c4966bcccc51552bd01549a9b13c04ab00a43f21/pandas-1.5.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.0 MB)
Collecting prettytable (from opencompass)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/02/c7/5613524e606ea1688b3bdbf48aa64bafb6d0a4ac3750274c43b6158a390f/prettytable-3.16.0-py3-none-any.whl (33 kB)
Requirement already satisfied: protobuf in /data/haitao/miniconda3/envs/opencompass/lib/python3.11/site-packages (from opencompass) (3.20.3)
Collecting pyext (from opencompass)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/b0/be/9b6005ac644aaef022527ce49617263379e49dbdbd433d1d3dd66d71f570/pyext-0.7.tar.gz (7.8 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [9 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-updtso81/pyext_0bace76d0af84dcfac854c085e291f5e/setup.py", line 6, in <module>
          import pyext
        File "/tmp/pip-install-updtso81/pyext_0bace76d0af84dcfac854c085e291f5e/pyext.py", line 117, in <module>
          oargspec = inspect.getargspec
                     ^^^^^^^^^^^^^^^^^^
      AttributeError: module 'inspect' has no attribute 'getargspec'. Did you mean: 'getargs'?
      [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.


### Other information

_No response_

I recommend using Python 3.10 to install OpenCompass.

可以参考https://github.com/open-compass/opencompass/pull/1985


@wanghaitaoofzjlab Thank you for your question. Closing this issue. Feel free to re-open if you need more help. @ShaohonChen Thanks for submitting a PR, we will review it.