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
相关推荐
计算机学姐1 天前
基于python+django+vue的在线学习资源推送系统
开发语言·vue.js·python·学习·django·pip·web3.py
BigYouYou2 天前
Pytorch2.4.0自动安装cudnn9.1??? pip安装cudnn方法
pytorch·pip
计算机学姐3 天前
基于python+django+vue+MySQL的酒店推荐系统
开发语言·vue.js·后端·python·mysql·django·pip
计算机学姐4 天前
基于python+django+vue的农业管理系统
开发语言·vue.js·后端·python·django·pip·web3.py
计算机学姐4 天前
基于python+django+vue的视频点播管理系统
vue.js·python·mysql·django·pip·web3.py·ipython
MaiXiaochai5 天前
【pipenv】—— 虚拟环境管理工具近乎全面的总结
python·pip·虚拟环境·dev·pipenv·pipfile·pipefile.lock
AI浩5 天前
Conda和pip 清空缓存
conda·pip
2301_796982145 天前
在pycharm终端中运行pip命令安装模块时,出现了“你要如何打开这个文件”弹出窗口,是什么状况?
pip
zixingcai6 天前
Python\Scripts文件夹中只有pip3.exe而缺少pip.exe
python·pip
Amd7946 天前
Nuxt Kit 的使用指南:从加载到构建
typescript·配置·nuxt·加载·构建·示例·kit