python package has name UNKNOWN

用 pip 从源码安装,pyproject.toml 中的包名不能被正确识别,显示为 UNKNOWN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Collecting git+https://github.com/suno-ai/bark.git
Cloning https://github.com/suno-ai/bark.git to /tmp/pip-req-build-t_euvdls
Running command git clone --filter=blob:none --quiet https://github.com/suno-ai/bark.git /tmp/pip-req-build-t_euvdls
Resolved https://github.com/suno-ai/bark.git to commit 97c6019ecdf1a70fdb313835c3bb3f770a0459e4
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: UNKNOWN
Building wheel for UNKNOWN (pyproject.toml) ... done
Created wheel for UNKNOWN: filename=UNKNOWN-0.0.0-py3-none-any.whl size=7276 sha256=a30755a229112b321e0b4ee3f6cc35ef61cbc02bedde64ac4c5c147f51ae64f8
Stored in directory: /tmp/pip-ephem-wheel-cache-54oie7jn/wheels/e6/6d/c2/107ed849afe600f905bb4049a026df3c7c5aa75d86c2721ec7
Successfully built UNKNOWN
Installing collected packages: UNKNOWN
Successfully installed UNKNOWN-0.0.0

其中的一个可能的原因是 pip 版本不够新

1
2
3
4
5
6
7
8
9
10
11
# pip install -U pip
Requirement already satisfied: pip in /usr/lib/python3/dist-packages (22.0.2)
Collecting pip
Downloading pip-23.1.1-py3-none-any.whl (2.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 3.5 MB/s eta 0:00:00
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 22.0.2
Not uninstalling pip at /usr/lib/python3/dist-packages, outside environment /usr
Can't uninstall 'pip'. No files were found to uninstall.
Successfully installed pip-23.1.1

更新后正常

1
2
3
4
5
6
7
8
9
Collecting git+https://github.com/suno-ai/bark.git
Cloning https://github.com/suno-ai/bark.git to /tmp/pip-req-build-gsgifvjp
Running command git clone --filter=blob:none --quiet https://github.com/suno-ai/bark.git /tmp/pip-req-build-gsgifvjp
Resolved https://github.com/suno-ai/bark.git to commit 97c6019ecdf1a70fdb313835c3bb3f770a0459e4
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Collecting boto3 (from suno-bark==0.0.1a0)

同理,也有可能是 setuptools 的版本不够新,升级即可