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
相关推荐
猫头虎2 天前
如何解决 OpenClaw “Pairing required” 报错:两种官方解决方案详解
网络·windows·网络协议·macos·智能路由器·pip·scipy
淮北4944 天前
pip虚拟环境包的问题
开发语言·python·pip
Albert Edison4 天前
【Python】函数
java·linux·python·pip
不懒不懒4 天前
【机器学习:下采样 VS 过采样——逻辑回归在信用卡欺诈检测中的实践】
python·numpy·scikit-learn·matplotlib·pip·futurewarning
那我掉的头发算什么4 天前
【Mybatis】动态SQL与留言板小项目
数据库·spring boot·sql·spring·mybatis·配置
规划酱6 天前
Arcgis中pip安装ezdxf部分GIS有pyparsing安装失败的情况处理
python·arcgis·pip·规划酱
凉忆-6 天前
llama-factory训练大模型
python·pip·llama
肆意飞扬6 天前
Python篇:使用conda、pip的一些命令记录
python·conda·pip
Warren987 天前
Pytest Fixture 作用域详解:Function、Class、Module、Session 怎么选
面试·职场和发展·单元测试·pytest·pip·模块测试·jira
Java后端的Ai之路11 天前
【Python小知识】-pip install xxx 命令安装的 ,在电脑的哪个盘?
开发语言·python·pip·pip install