具有原因不明,還以是安裝的pip版本有點亂
具體參考:
https://blog.csdn.net/phker/article/details/118341214
https://pip.pypa.io/en/stable/installation/
我的操作:
- 安裝虛擬環境:python3 -m venv --without-pip env
- 切換到虛擬環境:source env/bin/activate
- 獲取pip安裝文件:wget https://bootstrap.pypa.io/get-pip.py
- 安裝pip:python get-pip.py
- 退出虛擬環境:deactivate
- 重新進入虛擬環境:source env/bin/activate
- 確認python:which python
- 確認pip:which pip