pip安装第三方库与设置

pip的使用

假如下载numpy

shell 复制代码
pip install numpy

pypi 镜像源「配置」

常用镜像源列表

text 复制代码
官方:https://pypi.org/simple
百度:https://mirror.baidu.com/pypi/simple/
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里:https://mirrors.aliyun.com/pypi/simple/
豆瓣:https://pypi.douban.com/simple/
中科大:https://pypi.mirrors.ustc.edu.cn/simple/

1、临时使用

bash 复制代码
pip install xxxxx -i https://mirror.baidu.com/pypi/simple/ 

2、长期设置

text 复制代码
pip config set global.index-url https://mirror.baidu.com/pypi/simple/

注:升级 pip 到最新的版本 (>=10.0.0) 后进行配置,详见

3、配置多个镜像源(负载均衡)

text 复制代码
pip config set global.extra-index-url "<url1> <url2>..."

pip升级

python -m pip install --upgrade pip

手动安装pip依赖库

所有conda安装的环境路径

E:\Anaconda3-2019.10-Windows-x86_64\envs

某环境中pip安装的第三方库位置:
E:\Anaconda3-2019.10-Windows-x86_64\envs\tensorflow-gpu\Lib\site-packages

bug

解决Win下使用.bat时conda activate python虚拟环境无效的问题

直接使用<虚拟坏境路径>/python.exe main.py

bug:sklearn通过pip下载后无法导入的情况

description:

When execute code:
import sklearn

Exception output:

from .qhnll import *

ImportError: DLL load failed:找不到指定的模块。
solution:

shell 复制代码
pip install mkl
pip install --user --ignore-installed scikit-learn
相关推荐
灿灿的金19 小时前
pip 与当前python环境版本不匹配,python安装库成功,还是提示没有该库
开发语言·python·pip
奖励02162 天前
没有conda,怎么用pip进行虚拟环境创建和包管理windows
python·pip
喜-喜4 天前
Python pip 缓存清理:全面方法与操作指南
python·缓存·pip
蜗牛去旅行吧10 天前
解决 `pip is configured with locations that require TLS/SSL` 错误
网络协议·ssl·pip
来自于狂人10 天前
解决 `pip install open-webui` 时的编译错误:Microsoft Visual C++ 14.0 或更高版本缺失
c++·microsoft·pip
余将董道而不豫兮11 天前
pip 与 conda 的故事
人工智能·python·深度学习·conda·pip
Yuezero_13 天前
【BUG】conda虚拟环境下,pip install安装直接到全局python目录中
pytorch·python·conda·bug·pip
伊织code13 天前
Dify - 创建 RAG Workflow 及 Restful HTTP 请求
api·配置·workflow·知识库·dify·rag·问答
uncle_ll13 天前
复制conda虚拟环境的几种方法
conda·pip·虚拟环境·pyenv·minconda
ssslar15 天前
Flutter PIP 插件 ---- iOS Video Call
flutter·ios·pip