Python: pip
pip documentation v22.0.3 (pypa.io)
configuration: https://pip.pypa.io/en/stable/topics/configuration/
pip: package installer for Python
file name convertion:
https://peps.python.org/pep-0427/#file-name-convention
pip-9.0.1-py2.py3-none-any.whl
is the version 9.0.1 build of the pip package, compatible with both Python 2 and 3, with no ABI - Application Binary Interface (pure Python), and compatible with any CPU architecture.
(VCS Support):
pip install git+https://github.com/tangentlabs/django-oscar-paypal.git@issue/34/oscar-0.6
Instructions to install from private repo using ssh credentials:
$ pip install git+ssh://git@github.com/myuser/foo.git@my_version
To install a package from a subdirectory, say stackoverflow
$ pip install git+ssh://git@github.com/myuser/foo.git@my_version#subdirectory=stackoverflow
This worked like charm:
pip3 install git+https://github.com/deepak1725/fabric8-analytics-worker.git@develop
Where :
develop: Branch
fabric8-analytics-worker.git : Repo
deepak1725: user
For HTTP
pip install git+https://github.com/<project_owner>/<project_name>
git+https://<your personal token>@github.com/mylibrary.git#egg=mylibrary
For SSH
pip install git+ssh://git@github.com/<project_owner>/<project_name>.git
pip install -e git+ssh://git@github.corp.ebay.com/krylov/pykrylov.git@master#egg=pykrylov
For Local Git Repository
pip install git+file///path/to/your/git/project/
PyPi: Python package index
Linux:
配置文件路径:/etc/pip.conf ~/.pip/pip.conf
Windows:
配置文件路径:%appdata%\pip\pip.ini %userprofile%\pip\pip.ini
常用配置:
[global] index-url=http://mirrors.aliyun.com/pypi/simple extra-index-url=https://pypi.tuna.tsinghua.edu.cn/simple # proxy=http://user:password@proxy_name:port timeout=120 trusted-host=mirrors.aliyun.com quiet=0 verbose=2 [install] ignore-installed=true no-compile=false no-dependencies=false no-warn-script-location=false [freeze] timeout=10
常用用法:
- pip search -v
- pip installpip uninstall
- pip install --requirement | -r requirements Install from the given requirements file
- pip install --upgrade | -U Upgrade all specified packages
- pip list -v list installed packges
- pip freeze -v Ouput installed packges in requirements format
- pip show Show information about installed packages
pip show -f | --files Show the full list of installed files - pip completion --bash >> .bash_profile Command completion
- for b in $(pip list --outdated | tail -n +3 | awk '{print $1}');do pip install --upgraed $b;done 升级所有--outdated包
- pip install tea 'cup >= 3.13'
whl安装和使用:
wheel文件的本质就是zip或rar,其方便python的安装和使用,pip install.
scikit_learn‑0.19.1‑cp27‑cp27m‑win32.whl
cp27 <==> cpython2.7
win32 <==> 32bits
cp37 <==> cpython3.7
win_amd64 <==> 64bits
whl下载站:https://www.lfd.uci.edu/~gohlke/pythonlibs/
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律