Python使用
Hz 2026-11-22 Sunday
总结一些Python相关的用法
离线更新pip
获取get-pip.py
修改内容
- changing with
open(pip_zip, "wb") as fptowith 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
参考
- How to install python pip without Internet connection? (opens new window)
- module ‘pip‘ has no attribute ‘pep425tags‘的解决方案 (opens new window)
- Archived: Unofficial Windows Binaries for Python Extension Packages (opens new window)
快速下载安装包
使用镜像启动
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
2