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
相关推荐
oscar99920 小时前
探秘Claude Code的“.claude”目录:那些藏在背后的配置与记忆
memory·配置·rule·claude code·sikil
li99yo1 天前
3DGS的复现
图像处理·pytorch·经验分享·python·3d·conda·pip
Dontla1 天前
用pip install -e .开发Python包时,Python项目目录结构(项目结构)(可编辑安装editable install)
python·pip
今夕资源网2 天前
零基础 Python 环境搭建工具 一键安装 Python 环境自动配置 升级 pip、setuptools、wheel
开发语言·python·pip·环境变量·python环境变量·python自动安装
HelloTonyGo3 天前
个人游戏笔记本免费“养龙虾”(三)OpenClaw的安全配置指南
ubuntu·网络安全·配置·读写权限·openclaw
这个名有人用不4 天前
解决 uv 虚拟环境使用 pip 命令提示command not found的办法
python·pip·uv·claude code
七夜zippoe4 天前
OpenClaw 接入飞书:完整配置指南
人工智能·microsoft·飞书·配置·openclaw
疯狂吧小飞牛5 天前
daemon.json–docker常用配置
docker·配置
猿界零零七6 天前
pip install mxnet 报错解决方案
python·pip·mxnet
万粉变现经纪人8 天前
如何解决 pip install shapely 报错 GEOS C 库未找到 问题
c语言·开发语言·python·pycharm·bug·pandas·pip