[Bug] 在 Kubuntu 25.04 上安装失败:externally-managed-environment (PEP 668)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 78
- Forks
- 64
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 7
Description
环境信息
操作系统:Kubuntu 25.04 (任何启用了 PEP 668 保护的版本)
Python 版本:3.12+ 或 3.13+
Env 安装方式:install_ubuntu.sh --gitee
问题描述
执行官方提供的 install_ubuntu.sh 脚本时,运行到 pip install scons requests tqdm kconfiglib pyyaml 这一步失败,错误信息为:
text
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
...
这是因为 Ubuntu 从 23.04 开始默认遵循 PEP 668,禁止直接使用 pip 向系统级 Python 环境安装包,以避免与 APT 包管理器冲突。
改用 APT 安装依赖:检测到 Ubuntu 版本 ≥ 23.04 时,使用 apt install scons python3-requests python3-tqdm python3-kconfiglib python3-yaml 代替 pip install。
目前用户可以手动执行以下命令来绕过该问题:
bash
方法1:APT 安装(推荐)
sudo apt install scons python3-requests python3-tqdm python3-kconfiglib python3-yaml
然后重新执行 install_ubuntu.sh(但需跳过 pip install 那行,或手动运行剩余步骤)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with install_ubuntu.sh and locate the pip install scons requests tqdm kconfiglib pyyaml step. Reproduce the failure on an Ubuntu or Kubuntu release using PEP 668, then verify that supported newer releases install the listed dependencies through APT and that the remaining installation steps still run successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, python
- Domain
- devops, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100