Pip常见命令

3 阅读1分钟

设置全局下载镜像

pip config set global.index-url pypi.tuna.tsinghua.edu.cn/simple

查询模块是否存在

pip list | findstr dashscope

指定镜像下载模块

pip install dashscope -i mirrors.aliyun.com/pypi/simple…

首先,激活你想要修改的环境(例如当前环境)

conda activate myenv

将当前环境的 Python 版本更新到 3.11

conda install python=3.11

更新pip和setuptools:确保你的打包工具是最新的

pip install --upgrade pip setuptools wheel

使用Conda:如果你正在使用 Anaconda 或 Miniconda,可以尝试从 conda-forge 频道安装,它通常提供了预编译好的版本,能避免编译问题

conda install -c conda-forge pcapy

pcapy 是一个 Python 库,它的核心作用就是让你能用 Python 代码去捕获和分析网络上的数据包

scapy

Hugging Face modelScope

pip install sentence_transformers

sentence_transformers是连接langchin和HuggingFace的桥梁,sentence-transformers 来加载 bge-large-zh-v1.5 模型

安装sentence_transformers

conda install -c conda-forge sentence_transformers

查询某个模块的版本

pip show langchain langchain-core

升级版本 pip install --upgrade langchain langchain-core

pip install langchain==0.3.7 langchain-core==1.2.20

conda install -c conda-forge numexp