python
install_error
ai_generated
true
No module named pip # after: python -m venv .venv && source .venv/bin/activate && pip install requests
ID: python/pip-venv-without-pip
80%Fix Rate
88%Confidence
0Evidence
2024-07-25First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
The venv was created with --without-pip, or ensurepip is unavailable (Debian's python3-venv split package), so the new environment has no pip.
generic中文
venv 使用 --without-pip 创建,或 ensurepip 不可用(Debian 的 python3-venv 分离包),因此新环境没有 pip。
Workarounds
-
95% success
python -m ensurepip --upgrade python -m pip install --upgrade pip
-
97% success
sudo apt install python3-venv python3-pip rm -rf .venv python3 -m venv .venv source .venv/bin/activate python -m pip install requests
Dead Ends
Common approaches that don't work:
-
95% fail
pip is the thing that is missing; the command cannot run.
-
80% fail
Mixes system and venv paths, leading to subtle import and shebang issues.