Python使用

2026-11-22 Sunday

总结一些Python相关的用法

离线更新pip

获取get-pip.py

get-pip.py (opens new window)

修改内容

  • changing with open(pip_zip, "wb") as fp to with open ("pip.zip", "wb") as fp.
  • Remove bootstrap(tmpdir=tmpdir).
  • Run it, unzip pip.zip, and copy the new pip directory to /usr/lib/pythonX.Y

查询pip支持的版本

python -m pip debug --verbose
1

参考

快速下载安装包

使用镜像启动

docker run --rm --entrypoint python python:3.8.5-slim -m http.server
1

下载

docker exec -it XXXXXX /bin/bash
pip download XXXX
1
2
最近更新: 2026-11-22 17:33:40